module-menu-vue 0.0.32 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "module-menu-vue",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "城市大数据平台菜单--Vue版",
5
5
  "main": "/index.js",
6
6
  "scripts": {
@@ -2,7 +2,7 @@ import axios from 'axios';
2
2
  import baseCof from './config';
3
3
  import getStore from './userInfo';
4
4
  import { checkToken} from './permessionUtils';
5
-
5
+ const DEFAULT_LOGOUT_URL = '/#/login'
6
6
  let tokenValue = '574536b1-5832-417b-b909-82e204679d67';
7
7
 
8
8
  axios.interceptors.response.use(
@@ -34,7 +34,7 @@ axios.interceptors.response.use(
34
34
  }
35
35
  }
36
36
  console.log('=========', JSON.stringify(error.response))
37
- return Promise.reject(error.response.data);
37
+ return Promise.reject(error.response);
38
38
  },
39
39
  );
40
40
 
@@ -84,17 +84,16 @@ function Axios(method, api, params, map) {
84
84
  };
85
85
  console.log('httpDefult', JSON.stringify(httpDefult))
86
86
 
87
- return new Promise((resolve, reject) => {
88
- axios(httpDefult)
89
- .then((res) => {
90
- console.log('res', res)
91
- resolve(res);
92
- })
93
- .catch((err) => {
94
- console.log('err', err)
95
- reject(err);
96
- });
97
- })
87
+ axios(httpDefult)
88
+ .then((res) => {
89
+ console.log('res: ', res)
90
+ localStorage.clear();
91
+ sessionStorage.clear();
92
+ window.location.href = DEFAULT_LOGOUT_URL;
93
+ })
94
+ .catch((err) => {
95
+ console.log('err: ', err)
96
+ });
98
97
  }
99
98
 
100
99
  export default Axios;