Browse Source

token过期

CzRger 1 year ago
parent
commit
0846bbe2e2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/api/interceptors.ts

+ 2 - 2
src/api/interceptors.ts

@@ -41,8 +41,8 @@ export class Interceptors {
       // 请求成功
       (res: any) => {
         if (res.status === 200) {
-          if (res.data?.code === 402 || res.data?.code === 401 || res.data?.code === 500) {
-            ElMessage.warning(res.data.msg)
+          if (res.data?.status === 500) {
+            ElMessage.warning(res.data.message)
             sessionStorage.removeItem('sg_token')
             toLogin()
           } else {