Jelajahi Sumber

fix:退出登录优化

刘恒 1 tahun lalu
induk
melakukan
98f4a2058a
3 mengubah file dengan 15 tambahan dan 12 penghapusan
  1. 2 2
      .env.development
  2. 1 0
      src/layouts/header/HeaderAvatar.vue
  3. 12 10
      src/utils/request.js

+ 2 - 2
.env.development

@@ -1,5 +1,5 @@
-VUE_APP_API_BASE_URL='http://192.168.0.42:8080'
-
+VUE_APP_API_BASE_URL='https://test.baoxianzhanggui.com/web-api'
+VUE_APP_BASE_URL='https://test.baoxianzhanggui.com'
 #VUE_APP_API_BASE_URL='https://test.baoxianzhanggui.com/web-api'
 #VUE_APP_BASE_URL='https://test.baoxianzhanggui.com'
 

+ 1 - 0
src/layouts/header/HeaderAvatar.vue

@@ -52,6 +52,7 @@ export default {
       logout();
       // this.$router.push('/login')
       // console.log(this.process);
+      // debugger;
 
       window.location.href = this.process + "/#/login";
     },

+ 12 - 10
src/utils/request.js

@@ -80,17 +80,19 @@ function setAuthorization(auth, authType = AUTH_TYPE.BEARER) {
  * 移出认证信息
  * @param authType {AUTH_TYPE} 认证类型
  */
-function removeAuthorization(authType = AUTH_TYPE.BEARER) {
-  switch (authType) {
-    case AUTH_TYPE.BEARER:
+function removeAuthorization() {
+  // switch (authType) {
+  //   case AUTH_TYPE.BEARER:
+      Cookie.set('token','')
+
       Cookie.remove(xsrfHeaderName)
-      break
-    case AUTH_TYPE.BASIC:
-    case AUTH_TYPE.AUTH1:
-    case AUTH_TYPE.AUTH2:
-    default:
-      break
-  }
+    //   break
+    // case AUTH_TYPE.BASIC:
+    // case AUTH_TYPE.AUTH1:
+    // case AUTH_TYPE.AUTH2:
+    // default:
+    //   break
+  // }
 }
 
 /**