user接口修改并测试

This commit is contained in:
Ran_Chen
2025-04-01 10:59:35 +08:00
parent a345d41e9e
commit 5998fc3edd
7 changed files with 84 additions and 72 deletions
+3 -2
View File
@@ -105,11 +105,12 @@ function httpHandlerError(info, callBack) {
/** 请求成功,退出该函数 可以根据项目需求来判断是否请求成功。这里判断的是status为200的时候是成功 */
let networkError = false
if (info.status === 200) {
if (info.data.code === 'success' || info.data.code === 0 || info.data.code === undefined) {
return networkError
}else if (info.data.code === 401) {
goToPage(Constant.PAGE.LOGIN, true)
console.log('触发 401,清除 Token 并跳转登录页');
store.commit('clearAuth');
window.location.href = '/login';
return true
} else {
showDanger(info.data.msg)