Browse Source

尝试修改

1
mo 2 years ago
parent
commit
e2624c7e17

+ 0 - 1
src/utils/auth.js

@@ -9,7 +9,6 @@ export function getKeyWordKey() {
 }
 
 export function getToken() {
-  console.log(Cookies.get(TokenKey))
   return Local.get('token') ||  Session.get('token') || Cookies.get(TokenKey)
 }
 

+ 2 - 1
src/utils/request.js

@@ -60,8 +60,9 @@ service.interceptors.response.use(
 
       // 401:未登录;
       if (res.code === 401 || res.code === 403) {
-        console.log('401/403')
+
         location = window.location.origin;
+        console.log('401/403',location)
 
         // MessageBox.confirm('登录过期请重新登录', '确定登出', {
         //   confirmButtonText: '重新登录',

+ 3 - 1
src/views/layout/components/Navbar.vue

@@ -52,7 +52,9 @@ export default {
     },
     logout() {
       this.$store.dispatch('LogOut').then(() => {
-        location.reload() // 为了重新实例化vue-router对象 避免bug
+        location.reload(true) // 为了重新实例化vue-router对象 避免bug
+        // console.log(location.hostname+'/mall')
+        // location.href = location.hostname+'/mall'
       })
     }
   }

+ 3 - 3
src/views/pms/product/components/ProductDetail.vue

@@ -174,7 +174,7 @@ export default {
                 message: "提交成功",
                 duration: 1000,
               });
-              this.$router.back();
+              this.$router.push('/pms/product')
             }
           );
         });
@@ -190,11 +190,11 @@ export default {
               message: "提交成功",
               duration: 1000,
             });
-            this.$router.back();
+            this.$router.push('/pms/product')
           });
         });
       } else {
-        this.$router.back();
+        this.$router.push('/pms/product')
       }
     },
   },