Pārlūkot izejas kodu

过期清理个人数据

chenjj 3 dienas atpakaļ
vecāks
revīzija
6e81d39bc1
2 mainītis faili ar 8 papildinājumiem un 7 dzēšanām
  1. 1 1
      config.js
  2. 7 6
      utils/request.ts

+ 1 - 1
config.js

@@ -3,7 +3,7 @@ const config = {
   // baseUrl: 'https://vue.ruoyi.vip/prod-api',
   //cloud后台网关地址
   // baseUrl: 'http://192.168.100.139:9527', //嵘哥
-  // baseUrl: 'http://192.168.100.122:9527',//龙哥
+  // baseUrl: 'http://192.168.100.128:9527',//龙哥
   // baseUrl: 'http://192.168.100.122:9527',
   baseUrl: 'https://goldshulin.com/prod-api',
   mapKey: 'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',

+ 7 - 6
utils/request.ts

@@ -42,14 +42,15 @@ const request = <T>(config:RequestConfig):Promise<ResponseData<T>> => {
       // @ts-ignore
       const msg:string = errorCode[code] || data.msg || errorCode['default']
       if (code === 401) {
-        removeToken();
-        showConfirm('您还未登陆系统,是否前往登陆?').then(res => {
-          if (res.confirm) {
-            store.dispatch('LogOut').then(res => {
+        store.dispatch('LogOut').then(res => {
+          showConfirm('您还未登陆系统,是否前往登陆?').then(res => {
+            if (res.confirm) {
               uni.navigateTo({ url: '/pages/login' })
-            })
-          }
+            }
+          })
         })
+        // removeToken();
+       
 
         reject('无效的会话,或者会话已过期,请重新登录。')
       } else if (code === 500) {