Compare commits

...

7 Commits

Author SHA1 Message Date
Xhofe
56b3b35556 chore: Merge pull request #984 from Xhofe/dev
2.4.2
2022-04-21 22:34:12 +08:00
Xhofe
a7a0e85a46 docs: update qq group 2022-04-21 22:31:17 +08:00
Xhofe
95c0106fdd feat(onedrive): default redirect_uri(close #967) 2022-04-20 15:21:48 +08:00
Xhofe
6612338fc1 fix(189pc): InvalidSessionKey (fix #920) 2022-04-20 15:16:30 +08:00
Xhofe
c276a1541f chore: delete useless comment 2022-04-18 18:32:29 +08:00
Xhofe
cc96a5bbdb chore: add windows bin to gitignore 2022-04-18 18:31:10 +08:00
Xhofe
0810561a8a fix(xunlei): check err prevent stack overflow 2022-04-18 18:29:21 +08:00
9 changed files with 21 additions and 13 deletions

1
.gitignore vendored
View File

@@ -22,6 +22,7 @@ dist/
# vendor/ # vendor/
bin/* bin/*
/alist /alist
/alist.exe
*.json *.json
public/*.html public/*.html
public/assets/ public/assets/

View File

@@ -658,4 +658,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/>.

View File

@@ -87,4 +87,4 @@ The `AList` is open-source software licensed under the AGPL-3.0 license.
--- ---
> [@Blog](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=OVPJcv2b) > [@Blog](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=YJJj2Gwb)

View File

@@ -87,4 +87,4 @@
--- ---
> [@Blog](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@TelegramGroup](https://t.me/alist_chat) · [@QQGroup](https://jq.qq.com/?_wv=1027&k=OVPJcv2b) > [@博客](https://nn.ci/) · [@GitHub](https://github.com/Xhofe) · [@Telegram](https://t.me/alist_chat) · [@QQ](https://jq.qq.com/?_wv=1027&k=YJJj2Gwb)

View File

@@ -12,7 +12,6 @@ import (
) )
func Init() bool { func Init() bool {
//bootstrap.InitLog()
bootstrap.InitConf() bootstrap.InitConf()
bootstrap.InitCron() bootstrap.InitCron()
bootstrap.InitModel() bootstrap.InitModel()

View File

@@ -291,6 +291,13 @@ func (s *State) Request(method string, fullUrl string, params Params, callback f
return nil, fmt.Errorf(erron.Msg) return nil, fmt.Errorf(erron.Msg)
} }
if erron.ErrorCode != "" { if erron.ErrorCode != "" {
switch erron.ErrorCode {
case "InvalidSessionKey":
if err := s.RefreshSession(account); err != nil {
return nil, err
}
return s.Request(method, fullUrl, params, callback, account)
}
return nil, fmt.Errorf(erron.ErrorMsg) return nil, fmt.Errorf(erron.ErrorMsg)
} }

View File

@@ -53,6 +53,7 @@ func (driver Onedrive) Items() []base.Item {
Label: "redirect uri", Label: "redirect uri",
Type: base.TypeString, Type: base.TypeString,
Required: true, Required: true,
Default: "https://tool.nn.ci/onedrive/callback",
}, },
{ {
Name: "refresh_token", Name: "refresh_token",

View File

@@ -245,12 +245,18 @@ func (s *State) Request(method string, url string, callback func(*resty.Request)
log.Debug(res.String()) log.Debug(res.String())
var e Erron var e Erron
utils.Json.Unmarshal(res.Body(), &e) err = utils.Json.Unmarshal(res.Body(), &e)
if err != nil {
return nil, err
}
switch e.ErrorCode { switch e.ErrorCode {
case 9: case 9:
s.newCaptchaToken(getAction(method, url), nil, account) _, err = s.newCaptchaToken(getAction(method, url), nil, account)
if err != nil {
return nil, err
}
fallthrough fallthrough
case 4122, 4121: case 4122, 4121: // Authorization expired
return s.Request(method, url, callback, account) return s.Request(method, url, callback, account)
case 0: case 0:
if res.StatusCode() == http.StatusOK { if res.StatusCode() == http.StatusOK {

View File

@@ -4,9 +4,3 @@ import "embed"
//go:embed * //go:embed *
var Public embed.FS var Public embed.FS
////go:embed index.html
//var Index embed.FS
//
////go:embed assets/**
//var Assets embed.FS