eoss-mobiles 0.2.13 → 0.2.15
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 +260 -199
- package/lib/config/api.js +4 -1
- package/lib/date.js +3 -3
- package/lib/eoss-mobile.common.js +746 -249
- package/lib/flow.js +362 -277
- package/lib/index.js +1 -1
- package/lib/notice-bar.js +2 -2
- package/lib/picker.js +260 -199
- package/lib/pull-refresh.js +2 -2
- package/lib/radio.js +260 -199
- package/lib/retrial-auth.js +2457 -0
- package/lib/selector.js +294 -233
- package/lib/table-column.js +260 -199
- package/lib/table.js +227 -172
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/retrial-auth.css +1 -0
- package/lib/utils/axios.js +140 -154
- package/lib/utils/http.js +5 -5
- package/lib/utils/util.js +71 -2
- package/package.json +1 -1
- package/packages/date/src/main.vue +1 -1
- package/packages/flow/src/components/Handle.vue +4 -1
- package/packages/flow/src/components/Opinion.vue +39 -3
- package/packages/flow/src/components/StartFlow.vue +3 -3
- package/packages/flow/src/main.vue +6 -0
- package/packages/retrial-auth/index.js +5 -0
- package/packages/retrial-auth/src/main.vue +257 -0
- package/packages/selector/src/selector-tree.vue +1 -1
- package/packages/selector/src/tree.vue +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/retrial-auth.css +1 -0
- package/packages/theme-chalk/src/index.scss +1 -0
- package/packages/theme-chalk/src/retrial-auth.scss +28 -0
- package/src/config/api.js +3 -0
- package/src/index.js +4 -1
- package/src/utils/axios.js +156 -174
- package/src/utils/http.js +15 -5
- package/src/utils/util.js +164 -84
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@import './common/var.scss';
|
|
2
|
+
.em-retrial-auth {
|
|
3
|
+
&-box {
|
|
4
|
+
padding: 10px;
|
|
5
|
+
background-color: #fff;
|
|
6
|
+
border-radius: 5px;
|
|
7
|
+
.van-cell {
|
|
8
|
+
padding-left: 0px;
|
|
9
|
+
padding-right: 0px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
&-icon-box{
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
padding: 20px 0px 10px 0px;
|
|
17
|
+
&-item{
|
|
18
|
+
margin:0px 5px;
|
|
19
|
+
display: inline-block;
|
|
20
|
+
padding: 7px;
|
|
21
|
+
background-color:#D9D9D9 ;
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
}
|
|
24
|
+
.active{
|
|
25
|
+
background-color:$--color-primary;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/config/api.js
CHANGED
|
@@ -2,6 +2,9 @@ import $ from '../utils/util';
|
|
|
2
2
|
var activiti = '/bpm';
|
|
3
3
|
var pending = '/bpm';
|
|
4
4
|
var mecp = $.getStorage('flowPath') || '';
|
|
5
|
+
export const initRetrialAuth = '/sso2/retrialAuth/initRetrialAuth'; // 初始化二级身份权限验证页面
|
|
6
|
+
export const getRetrialAuthCode = '/sso2/retrialAuth/getRetrialAuthCode'; // 获取二级身份验证验证码
|
|
7
|
+
export const codeRetrialAuth = '/sso2/retrialAuth/codeRetrialAuth';// 二级身份验证-验证码验证
|
|
5
8
|
// 获取机构/用户/角色/群组等选择器
|
|
6
9
|
export const selectObject = '/api/v1/mecpSys/selectObject.json';
|
|
7
10
|
// // 获取代码表数据
|
package/src/index.js
CHANGED
|
@@ -40,6 +40,7 @@ import Stepper from '../packages/stepper/index.js';
|
|
|
40
40
|
import Esign from '../packages/esign/index.js';
|
|
41
41
|
import Pagination from '../packages/pagination/index.js';
|
|
42
42
|
import Swipe from '../packages/swipe/index.js';
|
|
43
|
+
import RetrialAuth from '../packages/retrial-auth/index.js';
|
|
43
44
|
import PullRefresh from '../packages/pull-refresh/index.js';
|
|
44
45
|
import NoticeBar from '../packages/notice-bar/index.js';
|
|
45
46
|
|
|
@@ -84,6 +85,7 @@ const components = [
|
|
|
84
85
|
Esign,
|
|
85
86
|
Pagination,
|
|
86
87
|
Swipe,
|
|
88
|
+
RetrialAuth,
|
|
87
89
|
PullRefresh,
|
|
88
90
|
NoticeBar
|
|
89
91
|
];
|
|
@@ -99,7 +101,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
export default {
|
|
102
|
-
version: '0.2.
|
|
104
|
+
version: '0.2.15',
|
|
103
105
|
install,
|
|
104
106
|
Button,
|
|
105
107
|
ButtonGroup,
|
|
@@ -140,6 +142,7 @@ export default {
|
|
|
140
142
|
Esign,
|
|
141
143
|
Pagination,
|
|
142
144
|
Swipe,
|
|
145
|
+
RetrialAuth,
|
|
143
146
|
PullRefresh,
|
|
144
147
|
NoticeBar
|
|
145
148
|
};
|
package/src/utils/axios.js
CHANGED
|
@@ -1,189 +1,166 @@
|
|
|
1
1
|
import Axios from 'axios';
|
|
2
|
-
// import Vue from 'vue';
|
|
3
2
|
import { Toast } from 'eoss-mobile-vant';
|
|
4
3
|
import $ from './util';
|
|
5
4
|
import qs from 'qs';
|
|
6
5
|
let apiUrl = $.getStorage('host');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
config.headers['
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
delete config.data.userId;
|
|
26
|
-
} else if (config.url.indexOf('decisionSuperviseMeet') !== -1) {
|
|
27
|
-
config.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
28
|
-
Object.assign(data, config.data);
|
|
29
|
-
config.data = qs.stringify(data);
|
|
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
|
+
// clientKey: 'csjk'
|
|
13
|
+
},
|
|
14
|
+
withCredentials: false
|
|
15
|
+
});
|
|
16
|
+
http.interceptors.request.use(
|
|
17
|
+
config => {
|
|
18
|
+
if (type === 'post' && format) {
|
|
19
|
+
config.data = qs.stringify(params);
|
|
20
|
+
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
21
|
+
config.headers['content-type'] =
|
|
22
|
+
'application/x-www-form-urlencoded;charset=UTF-8';
|
|
23
|
+
}
|
|
30
24
|
} else {
|
|
31
|
-
config.headers['Content-Type']
|
|
32
|
-
'application/
|
|
33
|
-
if (
|
|
34
|
-
Object.prototype.toString
|
|
35
|
-
.call(config.data)
|
|
36
|
-
.slice(8, -1)
|
|
37
|
-
.toLowerCase() !== 'formdata'
|
|
38
|
-
) {
|
|
39
|
-
Object.assign(data, config.data);
|
|
40
|
-
config.data = qs.stringify(data);
|
|
25
|
+
if (!config.headers['content-type'] && !headers['Content-Type']) {
|
|
26
|
+
config.headers['content-type'] = 'application/json;charset=UTF-8';
|
|
41
27
|
}
|
|
28
|
+
config.data = params;
|
|
42
29
|
}
|
|
43
|
-
} else {
|
|
44
|
-
Object.assign(config.params, data);
|
|
45
|
-
config.headers['Content-Type'] = 'application/json;';
|
|
46
|
-
}
|
|
47
|
-
if ($.getStorage('token')) {
|
|
48
|
-
config.headers.Authorization = $.getStorage('token');
|
|
49
|
-
}
|
|
50
|
-
if ($.getStorage('deviceId')) {
|
|
51
|
-
config.headers.deviceId = $.getStorage('deviceId');
|
|
52
|
-
}
|
|
53
30
|
|
|
54
|
-
|
|
31
|
+
if ($.getStorage('token')) {
|
|
32
|
+
config.headers.Authorization = $.getStorage('token');
|
|
33
|
+
}
|
|
34
|
+
if ($.getStorage('deviceId')) {
|
|
35
|
+
config.headers.deviceId = $.getStorage('deviceId');
|
|
36
|
+
}
|
|
55
37
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
config.baseURL = 'https://release.cdgzjg.cn/';
|
|
61
|
-
}
|
|
62
|
-
if (config.url.search('affairs/getHandleInfosnew.json') !== -1) {
|
|
63
|
-
config.headers = {
|
|
64
|
-
token: sessionStorage.getItem('token'),
|
|
65
|
-
oueside_token: sessionStorage.getItem('token'),
|
|
66
|
-
deviceId: '432a320f99793e39',
|
|
67
|
-
Authorization: sessionStorage.getItem('token')
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
if (config.url.search('/getmyAccount.json') !== -1) {
|
|
71
|
-
delete config.params.userId;
|
|
72
|
-
}
|
|
73
|
-
if (config.url.search('/sso2/authCenter') !== -1) {
|
|
74
|
-
delete config.headers.clientKey;
|
|
75
|
-
delete config.headers.deviceId;
|
|
76
|
-
}
|
|
77
|
-
if (config.url.search('/appInfo') !== -1) {
|
|
78
|
-
config.headers.deviceId = $.getStorage('deviceId');
|
|
79
|
-
delete config.headers.clientKey;
|
|
80
|
-
}
|
|
81
|
-
if (
|
|
82
|
-
config.url.search('getPresetCustomInfo') !== -1 ||
|
|
83
|
-
config.url.search('registerNew') !== -1
|
|
84
|
-
) {
|
|
85
|
-
// config.baseURL = "/api";
|
|
86
|
-
config.headers.token = $.getStorage('token');
|
|
87
|
-
}
|
|
88
|
-
if (
|
|
89
|
-
config.url.search('mecp/overtime') !== -1 ||
|
|
90
|
-
config.url.search('mecp/leave') !== -1 ||
|
|
91
|
-
config.url.search('contractext') !== -1 ||
|
|
92
|
-
config.url.search('getSysParam') !== -1
|
|
93
|
-
) {
|
|
94
|
-
delete config.headers.deviceId;
|
|
95
|
-
}
|
|
96
|
-
// if(config.url.search('getVehicleMaintenanceInfoForAPP') !== -1 ) {
|
|
97
|
-
// delete config.headers.deviceId
|
|
98
|
-
// delete config.headers.Authorization
|
|
99
|
-
// delete config.headers.clientKey
|
|
100
|
-
// }
|
|
101
|
-
if (config.url.search('/bpm') !== -1) {
|
|
102
|
-
// config.baseURL = "/api";
|
|
103
|
-
// config.headers.Authorization = $.getStorage('token');
|
|
104
|
-
// config.headers.Deviceunique = $.getStorage('deviceunique');
|
|
105
|
-
// config.headers.Ssid = $.getStorage('ssid');
|
|
106
|
-
// delete config.headers.deviceId;
|
|
107
|
-
// delete config.headers.clientKey;
|
|
108
|
-
}
|
|
109
|
-
return config;
|
|
110
|
-
},
|
|
111
|
-
error => {
|
|
112
|
-
return Promise.error(error);
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
// 响应拦截器
|
|
116
|
-
http.interceptors.response.use(
|
|
117
|
-
response => {
|
|
118
|
-
if (response.status === 200) {
|
|
119
|
-
if (response.data.rCode === 64 || response.data.rCode === 27) {
|
|
120
|
-
$.H5TokenInvalid();
|
|
121
|
-
} else {
|
|
122
|
-
return Promise.resolve(response.data);
|
|
38
|
+
let a = '/config/';
|
|
39
|
+
|
|
40
|
+
if (config.url.search(a) !== -1 && config.url.search('appInfo') === -1) {
|
|
41
|
+
config.headers.clientKey = $.getStorage('clientKey') || 'csjk2';
|
|
123
42
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
43
|
+
if (config.url.search('api/financePhone/') !== -1) {
|
|
44
|
+
config.baseURL = 'https://release.cdgzjg.cn/';
|
|
45
|
+
}
|
|
46
|
+
if (config.url.search('affairs/getHandleInfosnew.json') !== -1) {
|
|
47
|
+
config.headers = {
|
|
48
|
+
token: sessionStorage.getItem('token'),
|
|
49
|
+
oueside_token: sessionStorage.getItem('token'),
|
|
50
|
+
deviceId: '432a320f99793e39',
|
|
51
|
+
Authorization: sessionStorage.getItem('token')
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (config.url.search('/getmyAccount.json') !== -1) {
|
|
55
|
+
delete config.params.userId;
|
|
56
|
+
}
|
|
57
|
+
if (config.url.search('/sso2/authCenter') !== -1) {
|
|
58
|
+
delete config.headers.clientKey;
|
|
59
|
+
delete config.headers.deviceId;
|
|
60
|
+
}
|
|
61
|
+
if (config.url.search('/appInfo') !== -1) {
|
|
62
|
+
config.headers.deviceId = $.getStorage('deviceId');
|
|
63
|
+
delete config.headers.clientKey;
|
|
64
|
+
}
|
|
65
|
+
if (
|
|
66
|
+
config.url.search('getPresetCustomInfo') !== -1 ||
|
|
67
|
+
config.url.search('registerNew') !== -1
|
|
68
|
+
) {
|
|
69
|
+
config.headers.token = $.getStorage('token');
|
|
70
|
+
}
|
|
71
|
+
if (
|
|
72
|
+
config.url.search('mecp/overtime') !== -1 ||
|
|
73
|
+
config.url.search('mecp/leave') !== -1 ||
|
|
74
|
+
config.url.search('contractext') !== -1 ||
|
|
75
|
+
config.url.search('getSysParam') !== -1
|
|
76
|
+
) {
|
|
77
|
+
delete config.headers.deviceId;
|
|
78
|
+
}
|
|
79
|
+
return config;
|
|
80
|
+
},
|
|
81
|
+
error => {
|
|
82
|
+
return Promise.error(error);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
http.interceptors.response.use(
|
|
86
|
+
response => {
|
|
87
|
+
if (response.status === 200) {
|
|
88
|
+
if (response.data.rCode === 64 || response.data.rCode === 27) {
|
|
89
|
+
$.H5TokenInvalid();
|
|
90
|
+
} else {
|
|
91
|
+
return Promise.resolve(response.data);
|
|
171
92
|
}
|
|
172
93
|
} else {
|
|
173
|
-
|
|
94
|
+
return Promise.reject(response.data);
|
|
174
95
|
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
96
|
+
},
|
|
97
|
+
error => {
|
|
98
|
+
if (error && error.response) {
|
|
99
|
+
if (error.response.status) {
|
|
100
|
+
switch (error.response.status) {
|
|
101
|
+
case 400:
|
|
102
|
+
error.message = '错误请求';
|
|
103
|
+
break;
|
|
104
|
+
case 401:
|
|
105
|
+
error.message = '未授权,请重新登录';
|
|
106
|
+
break;
|
|
107
|
+
case 403:
|
|
108
|
+
error.message = '登录过期,请重新登录';
|
|
109
|
+
$.removeStorage('userId');
|
|
110
|
+
break;
|
|
111
|
+
case 404:
|
|
112
|
+
error.message = '网络请求不存在';
|
|
113
|
+
break;
|
|
114
|
+
case 405:
|
|
115
|
+
error.message = '请求方法错误';
|
|
116
|
+
break;
|
|
117
|
+
case 408:
|
|
118
|
+
error.message = '请求超时';
|
|
119
|
+
break;
|
|
120
|
+
case 500:
|
|
121
|
+
error.message = '服务器端出错';
|
|
122
|
+
break;
|
|
123
|
+
case 501:
|
|
124
|
+
error.message = '网络未实现';
|
|
125
|
+
break;
|
|
126
|
+
case 502:
|
|
127
|
+
error.message = '网络错误';
|
|
128
|
+
break;
|
|
129
|
+
case 503:
|
|
130
|
+
error.message = '服务不可用';
|
|
131
|
+
break;
|
|
132
|
+
case 504:
|
|
133
|
+
error.message = '网络超时';
|
|
134
|
+
break;
|
|
135
|
+
case 505:
|
|
136
|
+
error.message = 'http版本不支持该请求';
|
|
137
|
+
break;
|
|
138
|
+
default:
|
|
139
|
+
error.message = `连接错误${error.response.status}`;
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
error.message = '接口出现问题,无法请求';
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
Toast({
|
|
146
|
+
message: error.message,
|
|
147
|
+
duration: 1500,
|
|
148
|
+
forbidClick: true
|
|
149
|
+
});
|
|
150
|
+
return Promise.reject(error);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
if (type === 'get' || type === 'GET') {
|
|
154
|
+
return http.get(url, params, headers, format);
|
|
155
|
+
} else {
|
|
156
|
+
return http.post(url, params, headers, format);
|
|
182
157
|
}
|
|
183
|
-
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// 响应拦截器
|
|
184
161
|
|
|
185
162
|
const base = {
|
|
186
|
-
get: (url, params = {}) => {
|
|
163
|
+
get: (url, params = {}, headers = {}, format = false) => {
|
|
187
164
|
if (params.params && url.search('registerNew') === -1) {
|
|
188
165
|
params.params.userId = params.params.userId
|
|
189
166
|
? params.params.userId
|
|
@@ -201,17 +178,22 @@ const base = {
|
|
|
201
178
|
params.userId = 'u1b9f3ce4731649e0b665af015d74c19b';
|
|
202
179
|
}
|
|
203
180
|
}
|
|
204
|
-
return
|
|
205
|
-
|
|
206
|
-
|
|
181
|
+
return ajax(
|
|
182
|
+
url,
|
|
183
|
+
{
|
|
184
|
+
params
|
|
185
|
+
},
|
|
186
|
+
headers,
|
|
187
|
+
format
|
|
188
|
+
);
|
|
207
189
|
},
|
|
208
|
-
post: (url, params
|
|
190
|
+
post: (url, params, headers, format) => {
|
|
209
191
|
if (params.params) {
|
|
210
192
|
params.params.userId = params.params.userId || $.getStorage('userId');
|
|
211
193
|
} else {
|
|
212
194
|
params.userId = params.userId || $.getStorage('userId');
|
|
213
195
|
}
|
|
214
|
-
return
|
|
196
|
+
return ajax(url, params, headers, format, 'post');
|
|
215
197
|
}
|
|
216
198
|
};
|
|
217
199
|
export default base;
|
package/src/utils/http.js
CHANGED
|
@@ -3,19 +3,29 @@ const request = options => {
|
|
|
3
3
|
let fn;
|
|
4
4
|
switch (options.type) {
|
|
5
5
|
case 'post':
|
|
6
|
-
fn = base.post(
|
|
6
|
+
fn = base.post(
|
|
7
|
+
options.url,
|
|
8
|
+
options.params,
|
|
9
|
+
options.headers,
|
|
10
|
+
options.format
|
|
11
|
+
);
|
|
7
12
|
break;
|
|
8
13
|
case 'POST':
|
|
9
|
-
fn = base.post(
|
|
14
|
+
fn = base.post(
|
|
15
|
+
options.url,
|
|
16
|
+
options.params,
|
|
17
|
+
options.headers,
|
|
18
|
+
options.format
|
|
19
|
+
);
|
|
10
20
|
break;
|
|
11
21
|
case 'get':
|
|
12
|
-
fn = base.get(options.url, options.params);
|
|
22
|
+
fn = base.get(options.url, options.params, options.headers = {});
|
|
13
23
|
break;
|
|
14
24
|
case 'GET':
|
|
15
|
-
fn = base.get(options.url, options.params);
|
|
25
|
+
fn = base.get(options.url, options.params, options.headers = {});
|
|
16
26
|
break;
|
|
17
27
|
default:
|
|
18
|
-
fn = base.get(options.url, options.params);
|
|
28
|
+
fn = base.get(options.url, options.params, options.headers = {});
|
|
19
29
|
}
|
|
20
30
|
return fn;
|
|
21
31
|
};
|