Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions drivers/quark_uc_tv/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"errors"
"net/http"
"strconv"
"strings"
"time"

"github.com/OpenListTeam/OpenList/v4/internal/model"
Expand Down Expand Up @@ -70,8 +71,16 @@ func (d *QuarkUCTV) request(ctx context.Context, pathname string, method string,
return nil, err
}
// 判断 是否需要 刷新 access_token
if e.Status == -1 && e.Errno == 10001 {
// token 过期
errInfoLower := strings.ToLower(strings.TrimSpace(e.ErrorInfo))
maybeTokenInvalid :=
(e.Status == -1 && (e.Errno == 10001 || e.Errno == 11001)) ||
Comment thread
xrgzs marked this conversation as resolved.
(errInfoLower != "" &&
(strings.Contains(errInfoLower, "access token") ||
strings.Contains(errInfoLower, "access_token") ||
strings.Contains(errInfoLower, "token无效") ||
strings.Contains(errInfoLower, "token 无效")))
Comment thread
xrgzs marked this conversation as resolved.
if maybeTokenInvalid {
// token 过期 / 无效
err = d.getRefreshTokenByTV(ctx, d.Addition.RefreshToken, true)
if err != nil {
return nil, err
Expand Down
Loading