feat: 优化登录逻辑

This commit is contained in:
2026-01-06 19:42:10 +08:00
parent 7e02429f6e
commit 9c658e9f9f
6 changed files with 30 additions and 30 deletions

View File

@@ -1,16 +1,14 @@
import { removeAccessToken } from "@/constant/token";
import request from "../base/request";
const wxLogin = (args) => {
const oauthToken = (args) => {
const config = {
header: {
Authorization: "Basic Y3VzdG9tOmN1c3RvbQ==", // 可在此动态设置 token
"Content-Type": "application/x-www-form-urlencoded",
},
};
removeAccessToken();
return request.post("/auth/oauth2/token", args, config);
};
@@ -40,7 +38,7 @@ const getPrivacyAgreement = (args) => {
};
export {
wxLogin,
oauthToken,
bindUserPhone,
checkUserPhone,
getLoginUserPhone,

View File

@@ -59,9 +59,8 @@ function request(url, args = {}, method = "POST", customConfig = {}) {
resolve(res.data);
if (res.statusCode && res.statusCode === 424) {
console.log("424错误重新登录");
// removeAccessToken();
removeAccessToken();
uni.$emit(NOTICE_EVENT_LOGOUT);
// goLogin();
}
},
fail: (err) => {