module-menu-vue 0.0.29 → 0.0.30
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
|
@@ -5,7 +5,15 @@ import { checkToken} from './permessionUtils';
|
|
|
5
5
|
|
|
6
6
|
let tokenValue = '574536b1-5832-417b-b909-82e204679d67';
|
|
7
7
|
|
|
8
|
-
axios.
|
|
8
|
+
const service = axios.create({
|
|
9
|
+
timeout: 40000,
|
|
10
|
+
headers: {
|
|
11
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
12
|
+
'Content-Type': 'application/json; charset=UTF-8'
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
service.interceptors.response.use(
|
|
9
17
|
(response) => {
|
|
10
18
|
if (response.status === 200) {
|
|
11
19
|
return response;
|
|
@@ -39,7 +47,7 @@ axios.interceptors.response.use(
|
|
|
39
47
|
);
|
|
40
48
|
|
|
41
49
|
/** 全局请求拦截器 */
|
|
42
|
-
|
|
50
|
+
service.interceptors.request.use(
|
|
43
51
|
async (params) => {
|
|
44
52
|
// 多种环境,对接门户时,需要在请求头中设置token等信息
|
|
45
53
|
const environmentList = ['production', 'development', 'test']
|
|
@@ -73,13 +81,14 @@ axios.interceptors.request.use(
|
|
|
73
81
|
},
|
|
74
82
|
);
|
|
75
83
|
|
|
76
|
-
function Axios(method, api) {
|
|
84
|
+
function Axios(method, api, params, map) {
|
|
77
85
|
let httpDefult = {};
|
|
78
86
|
// 退出登录
|
|
79
87
|
httpDefult = {
|
|
80
88
|
method: method,
|
|
81
89
|
url: `${baseCof.baseSever}${api}`,
|
|
82
|
-
params:
|
|
90
|
+
params: params,
|
|
91
|
+
...map
|
|
83
92
|
};
|
|
84
93
|
console.log('httpDefult', JSON.stringify(httpDefult))
|
|
85
94
|
|