eoss-mobiles 0.2.76 → 0.2.78
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/lib/checkbox.js +9 -9
- package/lib/config/api.js +1 -1
- package/lib/eoss-mobile.common.js +28 -29
- package/lib/flow-btn.js +9 -9
- package/lib/flow-list.js +9 -9
- package/lib/flow.js +42 -43
- package/lib/index.js +1 -1
- package/lib/picker.js +9 -9
- package/lib/radio.js +9 -9
- package/lib/retrial-auth.js +9 -9
- package/lib/selector.js +9 -9
- package/lib/table-column.js +9 -9
- package/package.json +1 -1
- package/packages/flow/src/components/Handle.vue +1602 -1602
- package/packages/flow/src/components/Reject.vue +8 -9
- package/packages/flow/src/components/TaskRead.vue +4 -3
- package/packages/flow/src/components/taskUnionExamine.vue +1 -1
- package/src/config/api.js +1 -1
- package/src/index.js +1 -1
- package/src/utils/axios.js +216 -216
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
:code="processObj.attachedCode"
|
|
10
10
|
:ownId="$route.query.pendingId"
|
|
11
11
|
:esign="esign"
|
|
12
|
-
:esignLineWidth="
|
|
13
|
-
$attrs['esign-line-width'] || $attrs['esignLineWidth']
|
|
14
|
-
"
|
|
12
|
+
:esignLineWidth="$attrs['esign-line-width'] || $attrs['esignLineWidth']"
|
|
15
13
|
@onInputOpintion="onInputOpintion"
|
|
16
14
|
:placeholder="opinionHandleExplainText"
|
|
17
15
|
:isOpinionRequired="isBanInputOpinion"
|
|
@@ -49,7 +47,7 @@ import { taskRejectHtml, toTaskRejectHtml } from '../../../../src/config/api';
|
|
|
49
47
|
import request from '../../../../src/utils/http.js';
|
|
50
48
|
import Opinion from './Opinion.vue';
|
|
51
49
|
import Message from './Message.vue';
|
|
52
|
-
import $ from '../../../../src/utils/util'
|
|
50
|
+
import $ from '../../../../src/utils/util';
|
|
53
51
|
export default {
|
|
54
52
|
name: 'Reject',
|
|
55
53
|
props: {
|
|
@@ -70,7 +68,7 @@ export default {
|
|
|
70
68
|
data() {
|
|
71
69
|
return {
|
|
72
70
|
showMsg: false, // 判断是否显示系统消息
|
|
73
|
-
opinionHandleExplainText:undefined,
|
|
71
|
+
opinionHandleExplainText: undefined,
|
|
74
72
|
showOpinion: false, // 常用意见弹框
|
|
75
73
|
form: {
|
|
76
74
|
opinion: undefined, // 审批意见
|
|
@@ -142,7 +140,7 @@ export default {
|
|
|
142
140
|
this.beforeSubmit({ pendingId: this.pendingId, ...this.form });
|
|
143
141
|
return;
|
|
144
142
|
}
|
|
145
|
-
this.form.mobileKey = $.getStorage('deviceId') || '123'
|
|
143
|
+
this.form.mobileKey = $.getStorage('deviceId') || '123';
|
|
146
144
|
let formData = new FormData();
|
|
147
145
|
if (this.form.isImageOpinion == 1) {
|
|
148
146
|
formData.append('file', this.file);
|
|
@@ -165,8 +163,8 @@ export default {
|
|
|
165
163
|
request({
|
|
166
164
|
url: _that.baseUrl ? _that.baseUrl + taskRejectHtml : taskRejectHtml,
|
|
167
165
|
type: 'post',
|
|
168
|
-
params: formData,
|
|
169
|
-
format:false
|
|
166
|
+
params: this.form.isImageOpinion == 1 ? formData : this.form,
|
|
167
|
+
format: false
|
|
170
168
|
}).then(res => {
|
|
171
169
|
if (res.status == 'success') {
|
|
172
170
|
this.$toast('操作成功');
|
|
@@ -218,7 +216,8 @@ export default {
|
|
|
218
216
|
this.nodeDefaultRejectOpinion =
|
|
219
217
|
nodeInfoMap.nodeExtAttr.nodeDefaultRejectOpinion;
|
|
220
218
|
this.isBanInputOpinion = nodeInfoMap.nodeExtAttr.isBanInputOpinion;
|
|
221
|
-
this.opinionHandleExplainText =
|
|
219
|
+
this.opinionHandleExplainText =
|
|
220
|
+
nodeInfoMap.nodeExtAttr.opinionHandleExplainText;
|
|
222
221
|
if (!this.isBanInputOpinion) {
|
|
223
222
|
this.isBanInputOpinion = 0;
|
|
224
223
|
}
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<script>
|
|
84
84
|
import Message from './Message.vue';
|
|
85
85
|
import {
|
|
86
|
-
|
|
86
|
+
toStartTaskReadHtml,
|
|
87
87
|
taskReadHtml,
|
|
88
88
|
getHandleInfoHtml,
|
|
89
89
|
toTaskTransferIndex,
|
|
@@ -147,7 +147,7 @@ export default {
|
|
|
147
147
|
computed: {
|
|
148
148
|
params() {
|
|
149
149
|
return {
|
|
150
|
-
pid: util.getStorage('orgId') || this.orgId
|
|
150
|
+
pid:this.taskReadType == '分阅'? '' : util.getStorage('orgId') || this.orgId
|
|
151
151
|
};
|
|
152
152
|
},
|
|
153
153
|
newType() {
|
|
@@ -287,13 +287,14 @@ export default {
|
|
|
287
287
|
if (_that.newType != 'taskReadAndEnd') delete params.taskAction;
|
|
288
288
|
|
|
289
289
|
request({
|
|
290
|
-
url: _that.baseUrl ? _that.baseUrl +
|
|
290
|
+
url: _that.baseUrl ? _that.baseUrl + toStartTaskReadHtml : toStartTaskReadHtml,
|
|
291
291
|
params: params
|
|
292
292
|
}).then(res => {
|
|
293
293
|
_that.$toast.clear();
|
|
294
294
|
if (res.status == 'success') {
|
|
295
295
|
this.processObj = res.data;
|
|
296
296
|
this.notificationMsgType = this.isMultiple();
|
|
297
|
+
// this.taskExamine = res.data.taskExamine
|
|
297
298
|
} else {
|
|
298
299
|
_that.$toast(res.message);
|
|
299
300
|
setTimeout(() => {
|
|
@@ -501,7 +501,7 @@ export default {
|
|
|
501
501
|
: this.type == 'takeAdvice'
|
|
502
502
|
? taskTakeAdvice
|
|
503
503
|
: taskUnionExamine,
|
|
504
|
-
params: formData,
|
|
504
|
+
params:isImageOpinion == 1? formData : info,
|
|
505
505
|
headers: { Accept: 'application/json,text/plain' },
|
|
506
506
|
type: 'post',
|
|
507
507
|
format: false
|
package/src/config/api.js
CHANGED
|
@@ -55,7 +55,7 @@ export const taskReadHtml = activiti + '/task/taskHandle/taskRead.dhtml';
|
|
|
55
55
|
// 获取分阅页面信息
|
|
56
56
|
// export const toStartTaskReadHtml = '/api/mecp/v1/mecpItask/toStartTaskReadHtml.json';
|
|
57
57
|
// 获取分阅信息
|
|
58
|
-
export const toStartTaskRead =
|
|
58
|
+
export const toStartTaskRead = '/bpm/v1/mecpItask/getNodeInfoHtml.json';
|
|
59
59
|
export const toStartTaskReadHtml =
|
|
60
60
|
activiti + mecp + '/bpmBackend/toTaskReadIndex';
|
|
61
61
|
// 获取转办页面数据
|
package/src/index.js
CHANGED
package/src/utils/axios.js
CHANGED
|
@@ -1,216 +1,216 @@
|
|
|
1
|
-
import Axios from 'axios';
|
|
2
|
-
import { Toast } from 'eoss-mobile-vant';
|
|
3
|
-
import $ from './util';
|
|
4
|
-
import qs from 'qs';
|
|
5
|
-
let apiUrl = $.getStorage('host');
|
|
6
|
-
|
|
7
|
-
const ajax = (url, params = {}, headers = {}, format = true, type = 'get') => {
|
|
8
|
-
let http = Axios.create({
|
|
9
|
-
baseURL: apiUrl,
|
|
10
|
-
timeout: 60000,
|
|
11
|
-
headers: {
|
|
12
|
-
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
|
13
|
-
},
|
|
14
|
-
withCredentials: false
|
|
15
|
-
});
|
|
16
|
-
http.interceptors.request.use(
|
|
17
|
-
config => {
|
|
18
|
-
if ((params.params || params) instanceof FormData === false) {
|
|
19
|
-
if (type === 'post' && !format) {
|
|
20
|
-
config.data = qs.stringify(params.params || params);
|
|
21
|
-
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
22
|
-
config.headers['content-type'] =
|
|
23
|
-
'application/x-www-form-urlencoded;charset=UTF-8';
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
27
|
-
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
28
|
-
}
|
|
29
|
-
config.params = params.params || params;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if ($.getStorage('token')) {
|
|
33
|
-
config.headers.Authorization = $.getStorage('token');
|
|
34
|
-
}
|
|
35
|
-
if ($.getStorage('deviceId')) {
|
|
36
|
-
config.headers.deviceId = $.getStorage('deviceId');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let a = '/config/';
|
|
40
|
-
|
|
41
|
-
if (config.url.search(a) !== -1 && config.url.search('appInfo') === -1) {
|
|
42
|
-
config.headers.clientKey = $.getStorage('clientKey') || 'csjk2';
|
|
43
|
-
}
|
|
44
|
-
if (config.url.search('api/financePhone/') !== -1) {
|
|
45
|
-
config.baseURL = 'https://release.cdgzjg.cn/';
|
|
46
|
-
}
|
|
47
|
-
if (config.url.search('affairs/getHandleInfosnew.json') !== -1) {
|
|
48
|
-
config.headers = {
|
|
49
|
-
token: sessionStorage.getItem('token'),
|
|
50
|
-
oueside_token: sessionStorage.getItem('token'),
|
|
51
|
-
deviceId: '432a320f99793e39',
|
|
52
|
-
Authorization: sessionStorage.getItem('token')
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
if (config.url.search('/getmyAccount.json') !== -1) {
|
|
56
|
-
delete config.params.userId;
|
|
57
|
-
}
|
|
58
|
-
if (config.url.search('/sso2/authCenter') !== -1) {
|
|
59
|
-
delete config.headers.clientKey;
|
|
60
|
-
delete config.headers.deviceId;
|
|
61
|
-
}
|
|
62
|
-
if (config.url.search('/appInfo') !== -1) {
|
|
63
|
-
config.headers.deviceId = $.getStorage('deviceId');
|
|
64
|
-
delete config.headers.clientKey;
|
|
65
|
-
}
|
|
66
|
-
if (
|
|
67
|
-
config.url.search('getPresetCustomInfo') !== -1 ||
|
|
68
|
-
config.url.search('registerNew') !== -1
|
|
69
|
-
) {
|
|
70
|
-
config.headers.token = $.getStorage('token');
|
|
71
|
-
}
|
|
72
|
-
if (
|
|
73
|
-
config.url.search('mecp/overtime') !== -1 ||
|
|
74
|
-
config.url.search('mecp/leave') !== -1 ||
|
|
75
|
-
config.url.search('contractext') !== -1 ||
|
|
76
|
-
config.url.search('getSysParam') !== -1
|
|
77
|
-
) {
|
|
78
|
-
delete config.headers.deviceId;
|
|
79
|
-
}
|
|
80
|
-
let accessToken = $.getStorage('accessToken');
|
|
81
|
-
let tenantId = $.getStorage('tenantId');
|
|
82
|
-
let authorization = $.getStorage('authorization') || $.getStorage('token');
|
|
83
|
-
let deviceId = $.getStorage('deviceId');
|
|
84
|
-
if (accessToken) {
|
|
85
|
-
config.headers['X-Coos-Client-Access-Token'] = accessToken;
|
|
86
|
-
}
|
|
87
|
-
if (tenantId) {
|
|
88
|
-
config.headers['X-Coos-Client-Tenant-Id'] = tenantId;
|
|
89
|
-
}
|
|
90
|
-
if (authorization) {
|
|
91
|
-
config.headers['Authorization'] = authorization;
|
|
92
|
-
}
|
|
93
|
-
if (deviceId) {
|
|
94
|
-
config.headers['deviceId'] = deviceId;
|
|
95
|
-
}
|
|
96
|
-
return config;
|
|
97
|
-
},
|
|
98
|
-
error => {
|
|
99
|
-
return Promise.error(error);
|
|
100
|
-
}
|
|
101
|
-
);
|
|
102
|
-
http.interceptors.response.use(
|
|
103
|
-
response => {
|
|
104
|
-
if (response.status === 200) {
|
|
105
|
-
if (response.data.rCode === 64 || response.data.rCode === 27) {
|
|
106
|
-
$.H5TokenInvalid();
|
|
107
|
-
} else {
|
|
108
|
-
return Promise.resolve(response.data);
|
|
109
|
-
}
|
|
110
|
-
} else {
|
|
111
|
-
return Promise.reject(response.data);
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
error => {
|
|
115
|
-
if (error && error.response) {
|
|
116
|
-
if (error.response.status) {
|
|
117
|
-
switch (error.response.status) {
|
|
118
|
-
case 400:
|
|
119
|
-
error.message = '错误请求';
|
|
120
|
-
break;
|
|
121
|
-
case 401:
|
|
122
|
-
error.message = '未授权,请重新登录';
|
|
123
|
-
break;
|
|
124
|
-
case 403:
|
|
125
|
-
error.message = '登录过期,请重新登录';
|
|
126
|
-
$.removeStorage('userId');
|
|
127
|
-
break;
|
|
128
|
-
case 404:
|
|
129
|
-
error.message = '网络请求不存在';
|
|
130
|
-
break;
|
|
131
|
-
case 405:
|
|
132
|
-
error.message = '请求方法错误';
|
|
133
|
-
break;
|
|
134
|
-
case 408:
|
|
135
|
-
error.message = '请求超时';
|
|
136
|
-
break;
|
|
137
|
-
case 500:
|
|
138
|
-
error.message = '服务器端出错';
|
|
139
|
-
break;
|
|
140
|
-
case 501:
|
|
141
|
-
error.message = '网络未实现';
|
|
142
|
-
break;
|
|
143
|
-
case 502:
|
|
144
|
-
error.message = '网络错误';
|
|
145
|
-
break;
|
|
146
|
-
case 503:
|
|
147
|
-
error.message = '服务不可用';
|
|
148
|
-
break;
|
|
149
|
-
case 504:
|
|
150
|
-
error.message = '网络超时';
|
|
151
|
-
break;
|
|
152
|
-
case 505:
|
|
153
|
-
error.message = 'http版本不支持该请求';
|
|
154
|
-
break;
|
|
155
|
-
default:
|
|
156
|
-
error.message = `连接错误${error.response.status}`;
|
|
157
|
-
}
|
|
158
|
-
} else {
|
|
159
|
-
error.message = '接口出现问题,无法请求';
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
Toast({
|
|
163
|
-
message: error.message,
|
|
164
|
-
duration: 1500,
|
|
165
|
-
forbidClick: true
|
|
166
|
-
});
|
|
167
|
-
return Promise.reject(error);
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
if (type === 'get' || type === 'GET') {
|
|
171
|
-
return http.get(url, params, headers, format);
|
|
172
|
-
} else {
|
|
173
|
-
return http.post(url, params, headers, format);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
// 响应拦截器
|
|
178
|
-
|
|
179
|
-
const base = {
|
|
180
|
-
get: (url, params = {}, headers = {}, format = false) => {
|
|
181
|
-
if (params.params && url.search('registerNew') === -1) {
|
|
182
|
-
params.params.userId = params.params.userId
|
|
183
|
-
? params.params.userId
|
|
184
|
-
: $.getStorage('userId');
|
|
185
|
-
} else if (url.search('registerNew') === -1) {
|
|
186
|
-
params.userId = params.userId ? params.userId : $.getStorage('userId');
|
|
187
|
-
}
|
|
188
|
-
if (url.search('mecpSys/login') !== -1) {
|
|
189
|
-
delete params.userId;
|
|
190
|
-
}
|
|
191
|
-
if (url.search('mecp.invest') !== -1) {
|
|
192
|
-
if (params.params) {
|
|
193
|
-
params.params.userId = 'u1b9f3ce4731649e0b665af015d74c19b';
|
|
194
|
-
} else {
|
|
195
|
-
params.userId = 'u1b9f3ce4731649e0b665af015d74c19b';
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return ajax(
|
|
199
|
-
url,
|
|
200
|
-
{
|
|
201
|
-
params
|
|
202
|
-
},
|
|
203
|
-
headers,
|
|
204
|
-
format
|
|
205
|
-
);
|
|
206
|
-
},
|
|
207
|
-
post: (url, params, headers, format) => {
|
|
208
|
-
if (params.params) {
|
|
209
|
-
params.params.userId = params.params.userId || $.getStorage('userId');
|
|
210
|
-
} else {
|
|
211
|
-
params.userId = params.userId || $.getStorage('userId');
|
|
212
|
-
}
|
|
213
|
-
return ajax(url, params, headers, format, 'post');
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
export default base;
|
|
1
|
+
import Axios from 'axios';
|
|
2
|
+
import { Toast } from 'eoss-mobile-vant';
|
|
3
|
+
import $ from './util';
|
|
4
|
+
import qs from 'qs';
|
|
5
|
+
let apiUrl = $.getStorage('host');
|
|
6
|
+
|
|
7
|
+
const ajax = (url, params = {}, headers = {}, format = true, type = 'get') => {
|
|
8
|
+
let http = Axios.create({
|
|
9
|
+
baseURL: apiUrl,
|
|
10
|
+
timeout: 60000,
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
|
13
|
+
},
|
|
14
|
+
withCredentials: false
|
|
15
|
+
});
|
|
16
|
+
http.interceptors.request.use(
|
|
17
|
+
config => {
|
|
18
|
+
if ((params.params || params) instanceof FormData === false) {
|
|
19
|
+
if (type === 'post' && !format) {
|
|
20
|
+
config.data = qs.stringify(params.params || params);
|
|
21
|
+
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
22
|
+
config.headers['content-type'] =
|
|
23
|
+
'application/x-www-form-urlencoded;charset=UTF-8';
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
27
|
+
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
28
|
+
}
|
|
29
|
+
config.params = params.params || params;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if ($.getStorage('token')) {
|
|
33
|
+
config.headers.Authorization = $.getStorage('token');
|
|
34
|
+
}
|
|
35
|
+
if ($.getStorage('deviceId')) {
|
|
36
|
+
config.headers.deviceId = $.getStorage('deviceId');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let a = '/config/';
|
|
40
|
+
|
|
41
|
+
if (config.url.search(a) !== -1 && config.url.search('appInfo') === -1) {
|
|
42
|
+
config.headers.clientKey = $.getStorage('clientKey') || 'csjk2';
|
|
43
|
+
}
|
|
44
|
+
if (config.url.search('api/financePhone/') !== -1) {
|
|
45
|
+
config.baseURL = 'https://release.cdgzjg.cn/';
|
|
46
|
+
}
|
|
47
|
+
if (config.url.search('affairs/getHandleInfosnew.json') !== -1) {
|
|
48
|
+
config.headers = {
|
|
49
|
+
token: sessionStorage.getItem('token'),
|
|
50
|
+
oueside_token: sessionStorage.getItem('token'),
|
|
51
|
+
deviceId: '432a320f99793e39',
|
|
52
|
+
Authorization: sessionStorage.getItem('token')
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (config.url.search('/getmyAccount.json') !== -1) {
|
|
56
|
+
delete config.params.userId;
|
|
57
|
+
}
|
|
58
|
+
if (config.url.search('/sso2/authCenter') !== -1) {
|
|
59
|
+
delete config.headers.clientKey;
|
|
60
|
+
delete config.headers.deviceId;
|
|
61
|
+
}
|
|
62
|
+
if (config.url.search('/appInfo') !== -1) {
|
|
63
|
+
config.headers.deviceId = $.getStorage('deviceId');
|
|
64
|
+
delete config.headers.clientKey;
|
|
65
|
+
}
|
|
66
|
+
if (
|
|
67
|
+
config.url.search('getPresetCustomInfo') !== -1 ||
|
|
68
|
+
config.url.search('registerNew') !== -1
|
|
69
|
+
) {
|
|
70
|
+
config.headers.token = $.getStorage('token');
|
|
71
|
+
}
|
|
72
|
+
if (
|
|
73
|
+
config.url.search('mecp/overtime') !== -1 ||
|
|
74
|
+
config.url.search('mecp/leave') !== -1 ||
|
|
75
|
+
config.url.search('contractext') !== -1 ||
|
|
76
|
+
config.url.search('getSysParam') !== -1
|
|
77
|
+
) {
|
|
78
|
+
delete config.headers.deviceId;
|
|
79
|
+
}
|
|
80
|
+
let accessToken = $.getStorage('accessToken');
|
|
81
|
+
let tenantId = $.getStorage('tenantId');
|
|
82
|
+
let authorization = $.getStorage('authorization') || $.getStorage('token');
|
|
83
|
+
let deviceId = $.getStorage('deviceId');
|
|
84
|
+
if (accessToken) {
|
|
85
|
+
config.headers['X-Coos-Client-Access-Token'] = accessToken;
|
|
86
|
+
}
|
|
87
|
+
if (tenantId) {
|
|
88
|
+
config.headers['X-Coos-Client-Tenant-Id'] = tenantId;
|
|
89
|
+
}
|
|
90
|
+
if (authorization) {
|
|
91
|
+
config.headers['Authorization'] = authorization;
|
|
92
|
+
}
|
|
93
|
+
if (deviceId) {
|
|
94
|
+
config.headers['deviceId'] = deviceId;
|
|
95
|
+
}
|
|
96
|
+
return config;
|
|
97
|
+
},
|
|
98
|
+
error => {
|
|
99
|
+
return Promise.error(error);
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
http.interceptors.response.use(
|
|
103
|
+
response => {
|
|
104
|
+
if (response.status === 200) {
|
|
105
|
+
if (response.data.rCode === 64 || response.data.rCode === 27) {
|
|
106
|
+
$.H5TokenInvalid();
|
|
107
|
+
} else {
|
|
108
|
+
return Promise.resolve(response.data);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
return Promise.reject(response.data);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
error => {
|
|
115
|
+
if (error && error.response) {
|
|
116
|
+
if (error.response.status) {
|
|
117
|
+
switch (error.response.status) {
|
|
118
|
+
case 400:
|
|
119
|
+
error.message = '错误请求';
|
|
120
|
+
break;
|
|
121
|
+
case 401:
|
|
122
|
+
error.message = '未授权,请重新登录';
|
|
123
|
+
break;
|
|
124
|
+
case 403:
|
|
125
|
+
error.message = '登录过期,请重新登录';
|
|
126
|
+
$.removeStorage('userId');
|
|
127
|
+
break;
|
|
128
|
+
case 404:
|
|
129
|
+
error.message = '网络请求不存在';
|
|
130
|
+
break;
|
|
131
|
+
case 405:
|
|
132
|
+
error.message = '请求方法错误';
|
|
133
|
+
break;
|
|
134
|
+
case 408:
|
|
135
|
+
error.message = '请求超时';
|
|
136
|
+
break;
|
|
137
|
+
case 500:
|
|
138
|
+
error.message = '服务器端出错';
|
|
139
|
+
break;
|
|
140
|
+
case 501:
|
|
141
|
+
error.message = '网络未实现';
|
|
142
|
+
break;
|
|
143
|
+
case 502:
|
|
144
|
+
error.message = '网络错误';
|
|
145
|
+
break;
|
|
146
|
+
case 503:
|
|
147
|
+
error.message = '服务不可用';
|
|
148
|
+
break;
|
|
149
|
+
case 504:
|
|
150
|
+
error.message = '网络超时';
|
|
151
|
+
break;
|
|
152
|
+
case 505:
|
|
153
|
+
error.message = 'http版本不支持该请求';
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
error.message = `连接错误${error.response.status}`;
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
error.message = '接口出现问题,无法请求';
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
Toast({
|
|
163
|
+
message: error.message,
|
|
164
|
+
duration: 1500,
|
|
165
|
+
forbidClick: true
|
|
166
|
+
});
|
|
167
|
+
return Promise.reject(error);
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
if (type === 'get' || type === 'GET') {
|
|
171
|
+
return http.get(url, params, headers, format);
|
|
172
|
+
} else {
|
|
173
|
+
return http.post(url, params, headers, format);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// 响应拦截器
|
|
178
|
+
|
|
179
|
+
const base = {
|
|
180
|
+
get: (url, params = {}, headers = {}, format = false) => {
|
|
181
|
+
if (params.params && url.search('registerNew') === -1) {
|
|
182
|
+
params.params.userId = params.params.userId
|
|
183
|
+
? params.params.userId
|
|
184
|
+
: $.getStorage('userId');
|
|
185
|
+
} else if (url.search('registerNew') === -1) {
|
|
186
|
+
params.userId = params.userId ? params.userId : $.getStorage('userId');
|
|
187
|
+
}
|
|
188
|
+
if (url.search('mecpSys/login') !== -1) {
|
|
189
|
+
delete params.userId;
|
|
190
|
+
}
|
|
191
|
+
if (url.search('mecp.invest') !== -1) {
|
|
192
|
+
if (params.params) {
|
|
193
|
+
params.params.userId = 'u1b9f3ce4731649e0b665af015d74c19b';
|
|
194
|
+
} else {
|
|
195
|
+
params.userId = 'u1b9f3ce4731649e0b665af015d74c19b';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return ajax(
|
|
199
|
+
url,
|
|
200
|
+
{
|
|
201
|
+
params
|
|
202
|
+
},
|
|
203
|
+
headers,
|
|
204
|
+
format
|
|
205
|
+
);
|
|
206
|
+
},
|
|
207
|
+
post: (url, params, headers, format) => {
|
|
208
|
+
if (params.params) {
|
|
209
|
+
params.params.userId = params.params.userId || $.getStorage('userId');
|
|
210
|
+
} else {
|
|
211
|
+
params.userId = params.userId || $.getStorage('userId');
|
|
212
|
+
}
|
|
213
|
+
return ajax(url, params, headers, format, 'post');
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
export default base;
|