fix: update login error

This commit is contained in:
2025-03-23 12:17:06 +08:00
parent 4b16ec8499
commit d56c4c15f2
8 changed files with 25 additions and 55 deletions

View File

@@ -34,20 +34,13 @@ query.beforeRequest = async (config) => {
};
query.afterResponse = async (response, ctx) => {
if (response.code === 401) {
if (query.stop) {
return {
code: 500,
message: '登录已过期',
};
}
query.stop = true;
const res = await queryLogin.afterCheck401ToRefreshToken(response, ctx);
query.stop = false;
return res;
console.log('401 after', response);
}
return response as any;
};
export const queryLogin = new QueryLoginNode({
query: query as any,
onLoad: async () => {},
onLoad: async () => {
// console.log('onLoad');
},
});