feat: 调整了登录的逻辑

This commit is contained in:
2026-05-12 21:17:11 +08:00
parent f0b6e86e64
commit 0f6d8f7ff1
7 changed files with 200 additions and 120 deletions

View File

@@ -8,7 +8,6 @@ const oauthToken = (args) => {
"Content-Type": "application/x-www-form-urlencoded",
},
};
removeAccessToken();
return request.post("/auth/oauth2/token", args, config);
};

View File

@@ -42,7 +42,7 @@ function request(url, args = {}, method = "POST", customConfig = {}) {
if (customConfig.noToken) {
delete header.Authorization;
} else {
if (token || customConfig.token) {
if (!header.Authorization && (token || customConfig.token)) {
header.Authorization = `Bearer ${token || customConfig.token}`;
}
}