zhaolf 3 anni fa
parent
commit
b72ba0b40b
3 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 1 1
      src/app.less
  2. 2 0
      src/pages/goods/index.vue
  3. 5 0
      src/utils/request.js

+ 1 - 1
src/app.less

@@ -35,7 +35,7 @@ html, body {
             background: white;
             margin: 10px;
             border-radius: 5px;
-            width: calc(100vw - 100px);
+            width: calc(100vw - 120px);
           }
           .blackbtn{
             background: #040000;

+ 2 - 0
src/pages/goods/index.vue

@@ -193,9 +193,11 @@
 <style lang="less" scoped>
 .wrapper{
   .btn_search {
+    width: 150px;
     margin-left: 10px;
   }
   .serach {
+    width: 100%;
     margin-bottom: 10px;
   }
 }

+ 5 - 0
src/utils/request.js

@@ -1,6 +1,7 @@
 import axios from 'axios'
 import store from '@/store'
 import { Message } from 'element-ui'
+import router from '../router'
 const service = axios.create({
   baseURL: global_config.BASE_URL,
   timeout: 500000,
@@ -32,6 +33,10 @@ service.interceptors.response.use(response => {
       type: 'error',
       duration: 3 * 1000
     })
+    if(res.code==401){
+      store.commit('CLEAR')
+      router.push('/');
+    }
   }
   return Promise.reject(res.Message)
 },