mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 13:54:04 +08:00
✨ update onedrive account status
This commit is contained in:
parent
7e099b39cf
commit
11b141b190
@ -146,9 +146,11 @@ func (o Onedrive) RefreshToken(account *model.Account) error {
|
||||
"refresh_token": account.RefreshToken,
|
||||
}).Post(url)
|
||||
if err != nil {
|
||||
account.Status = err.Error()
|
||||
return err
|
||||
}
|
||||
if e.Error != "" {
|
||||
account.Status = e.ErrorDescription
|
||||
return fmt.Errorf("%s", e.ErrorDescription)
|
||||
}
|
||||
account.RefreshToken, account.AccessToken = resp.RefreshToken, resp.AccessToken
|
||||
@ -280,9 +282,6 @@ func (o Onedrive) Save(account *model.Account, old *model.Account) error {
|
||||
return
|
||||
}
|
||||
err = o.RefreshToken(&newAccount)
|
||||
if err != nil {
|
||||
newAccount.Status = err.Error()
|
||||
}
|
||||
_ = model.SaveAccount(newAccount)
|
||||
})
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user