dedsudiyu 1 рік тому
батько
коміт
4f9efef6fc
3 змінених файлів з 23 додано та 16 видалено
  1. 6 0
      .env.production
  2. 10 9
      src/store/modules/user.js
  3. 7 7
      src/utils/request.js

+ 6 - 0
.env.production

@@ -18,3 +18,9 @@ VUE_APP_BASE_API = '192.168.62.195/api'
 
 VUE_APP_BASE_LOCAL_API = '192.168.62.195/api'
 
+# ####################认证平台版本退出接口####################
+
+VUE_APP_OUT_URL = '192.168.62.195/api'
+
+
+

+ 10 - 9
src/store/modules/user.js

@@ -140,15 +140,16 @@ const user = {
         commit('SET_ROLES', [])
         commit('SET_PERMISSIONS', [])
         removeToken()
-        logout(state.token).then(() => {
-          // commit('SET_TOKEN', '')
-          // commit('SET_ROLES', [])
-          // commit('SET_PERMISSIONS', [])
-          // removeToken()
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
+        window.location.href = process.env.VUE_APP_OUT_URL;
+        // logout(state.token).then(() => {
+        //   // commit('SET_TOKEN', '')
+        //   // commit('SET_ROLES', [])
+        //   // commit('SET_PERMISSIONS', [])
+        //   // removeToken()
+        //   resolve()
+        // }).catch(error => {
+        //   reject(error)
+        // })
       })
     },
 

+ 7 - 7
src/utils/request.js

@@ -55,9 +55,9 @@ service.interceptors.request.use(config => {
   }
   // 弹层相关
   loadingCount ++;
-  if(config.url == '/auth/logout'){
-    window.location.href = 'http://192.168.1.43/labSystem/auth/login';
-  }
+  // if(config.url == '/auth/logout'){
+  //   window.location.href = 'http://192.168.1.43/labSystem/auth/login';
+  // }
   return config
 }, error => {
   // 弹层相关
@@ -85,10 +85,10 @@ service.interceptors.response.use(res => {
     //   // window.location.href = 'https://icas.jnu.edu.cn/cas/login?service=http://localhost:8081/#/login';
     //   return
     // }
-    if(res.config.url == '/auth/logout'&&res.request.responseURL){
-      window.location.href = res.request.responseURL;
-      return
-    }
+    // if(res.config.url == '/auth/logout'&&res.request.responseURL){
+    //   window.location.href = res.request.responseURL;
+    //   return
+    // }
     if (code == 401) {
       if(!localStorage.getItem('serviceType')){
         localStorage.setItem('serviceType','1')