eoss-ui 0.7.75 → 0.7.77
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/button-group.js +68 -36
- package/lib/button.js +68 -36
- package/lib/calogin.js +68 -36
- package/lib/checkbox-group.js +68 -36
- package/lib/data-table-form.js +68 -36
- package/lib/data-table.js +68 -36
- package/lib/date-picker.js +68 -36
- package/lib/dialog.js +68 -36
- package/lib/eoss-ui.common.js +245 -113
- package/lib/flow-group.js +68 -36
- package/lib/flow-list.js +68 -36
- package/lib/flow.js +68 -36
- package/lib/form.js +68 -36
- package/lib/handle-user.js +68 -36
- package/lib/handler.js +68 -36
- package/lib/icon.js +68 -36
- package/lib/index.js +1 -1
- package/lib/input-number.js +68 -36
- package/lib/input.js +68 -36
- package/lib/login.js +75 -40
- package/lib/main.js +227 -98
- package/lib/nav.js +68 -36
- package/lib/page.js +68 -36
- package/lib/pagination.js +68 -36
- package/lib/player.js +68 -36
- package/lib/qr-code.js +68 -36
- package/lib/radio-group.js +68 -36
- package/lib/retrial-auth.js +68 -36
- package/lib/select-ganged.js +68 -36
- package/lib/select.js +68 -36
- package/lib/selector-panel.js +68 -36
- package/lib/selector.js +68 -36
- package/lib/sizer.js +68 -36
- package/lib/steps.js +68 -36
- package/lib/switch.js +68 -36
- package/lib/table-form.js +68 -36
- package/lib/tabs.js +68 -36
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/simplicity-top.css +1 -1
- package/lib/tips.js +68 -36
- package/lib/tree-group.js +68 -36
- package/lib/tree.js +68 -36
- package/lib/upload.js +68 -36
- package/lib/utils/util.js +68 -36
- package/lib/wujie.js +68 -36
- package/lib/wxlogin.js +68 -36
- package/package.json +1 -1
- package/packages/login/src/main.vue +5 -2
- package/packages/main/src/main.vue +27 -15
- package/packages/main/src/simplicity/index.vue +6 -0
- package/packages/main/src/simplicityTop/handler.vue +6 -0
- package/packages/main/src/simplicityTop/index.vue +74 -10
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/main.css +1 -1
- package/packages/theme-chalk/lib/simplicity-top.css +1 -1
- package/packages/theme-chalk/src/simplicity-top.scss +13 -0
- package/src/index.js +1 -1
- package/src/utils/util.js +172 -105
package/src/utils/util.js
CHANGED
|
@@ -96,7 +96,8 @@ const ajax = function ({
|
|
|
96
96
|
}
|
|
97
97
|
let http = $_http;
|
|
98
98
|
if (!http) {
|
|
99
|
-
let baseURL =
|
|
99
|
+
let baseURL =
|
|
100
|
+
host === true ? getStorage('host') : host === false ? '' : host;
|
|
100
101
|
http = axios.create({
|
|
101
102
|
baseURL: baseURL,
|
|
102
103
|
timeout: 99000,
|
|
@@ -125,23 +126,24 @@ const ajax = function ({
|
|
|
125
126
|
(response) => {
|
|
126
127
|
// delPendingRequest(response.config);
|
|
127
128
|
loading && loading.close();
|
|
128
|
-
if (
|
|
129
|
-
response.headers.authorization
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
key: ['token', 'Authorization'],
|
|
135
|
-
value: response.headers.authorization
|
|
136
|
-
});
|
|
129
|
+
if (response.headers.authorization) {
|
|
130
|
+
response.headers.authorization !== getStorage('token') &&
|
|
131
|
+
setStorage({
|
|
132
|
+
key: ['token', 'Authorization'],
|
|
133
|
+
value: response.headers.authorization
|
|
134
|
+
});
|
|
137
135
|
}
|
|
138
|
-
const ssId =
|
|
136
|
+
const ssId =
|
|
137
|
+
response.headers.ssId ||
|
|
138
|
+
response.headers.Ssid ||
|
|
139
|
+
response.headers.ssid;
|
|
139
140
|
|
|
140
141
|
if (ssId) {
|
|
141
|
-
ssId !== getStorage('ssId') &&
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
ssId !== getStorage('ssId') &&
|
|
143
|
+
setStorage({
|
|
144
|
+
key: 'ssId',
|
|
145
|
+
value: ssId
|
|
146
|
+
});
|
|
145
147
|
}
|
|
146
148
|
if (response.status === 200) {
|
|
147
149
|
responses(response.data);
|
|
@@ -325,7 +327,19 @@ const ajax = function ({
|
|
|
325
327
|
* @param {Object} [data] - 请求参数
|
|
326
328
|
* @param {Object} [params] - 请求参数
|
|
327
329
|
**/
|
|
328
|
-
const ajaxStream = function ({
|
|
330
|
+
const ajaxStream = function ({
|
|
331
|
+
controller,
|
|
332
|
+
method = 'post',
|
|
333
|
+
host,
|
|
334
|
+
url,
|
|
335
|
+
data,
|
|
336
|
+
params,
|
|
337
|
+
progress,
|
|
338
|
+
success,
|
|
339
|
+
fail,
|
|
340
|
+
final,
|
|
341
|
+
...configs
|
|
342
|
+
}) {
|
|
329
343
|
try {
|
|
330
344
|
// 如果有正在进行的请求,取消它
|
|
331
345
|
if (controller) {
|
|
@@ -335,13 +349,15 @@ const ajaxStream = function ({ controller, method = 'post', host, url, data, par
|
|
|
335
349
|
const baseURL = host || getStorage('baseHost') || '';
|
|
336
350
|
let userId = getStorage('userId');
|
|
337
351
|
if (
|
|
338
|
-
data &&
|
|
352
|
+
data &&
|
|
353
|
+
!Object.prototype.hasOwnProperty.call(data, 'userId') &&
|
|
339
354
|
userId
|
|
340
355
|
) {
|
|
341
356
|
data.userId = userId;
|
|
342
357
|
}
|
|
343
358
|
if (
|
|
344
|
-
params &&
|
|
359
|
+
params &&
|
|
360
|
+
!Object.prototype.hasOwnProperty.call(params, 'userId') &&
|
|
345
361
|
userId
|
|
346
362
|
) {
|
|
347
363
|
params.userId = getStorage('userId');
|
|
@@ -369,9 +385,10 @@ const ajaxStream = function ({ controller, method = 'post', host, url, data, par
|
|
|
369
385
|
data,
|
|
370
386
|
params,
|
|
371
387
|
...configs,
|
|
372
|
-
onDownloadProgress: progressEvent => {
|
|
388
|
+
onDownloadProgress: (progressEvent) => {
|
|
373
389
|
// 获取从上次处理后新增的数据
|
|
374
|
-
const currentResponse = (progressEvent.event || progressEvent)
|
|
390
|
+
const currentResponse = (progressEvent.event || progressEvent)
|
|
391
|
+
.currentTarget.responseText;
|
|
375
392
|
const chunk = currentResponse.slice(lastProcessedIndex);
|
|
376
393
|
if (chunk === 'data:') {
|
|
377
394
|
return;
|
|
@@ -386,12 +403,14 @@ const ajaxStream = function ({ controller, method = 'post', host, url, data, par
|
|
|
386
403
|
let remainingData = ''; // 用于保存未完整处理的部分数据
|
|
387
404
|
let primeval = '';
|
|
388
405
|
let chunks = '';
|
|
389
|
-
lines.forEach(line => {
|
|
406
|
+
lines.forEach((line) => {
|
|
390
407
|
if (line === '') {
|
|
391
408
|
return;
|
|
392
409
|
}
|
|
393
410
|
// if (line.startsWith('data:')) {
|
|
394
|
-
const data = line.startsWith('data:')
|
|
411
|
+
const data = line.startsWith('data:')
|
|
412
|
+
? line.replace('data:', '').trim()
|
|
413
|
+
: line.trim();
|
|
395
414
|
if (data) {
|
|
396
415
|
try {
|
|
397
416
|
// 假设数据是 JSON 格式
|
|
@@ -451,17 +470,18 @@ const ajaxStream = function ({ controller, method = 'post', host, url, data, par
|
|
|
451
470
|
partialData = remainingData;
|
|
452
471
|
progress && progress({ message: info, controller, done });
|
|
453
472
|
}
|
|
454
|
-
}).then((results) => {
|
|
455
|
-
// 处理请求完成后的信息
|
|
456
|
-
const originalText = info.content;
|
|
457
|
-
const regex = /<think>([\s\S]*?)<\/think>([\s\S]*)/;
|
|
458
|
-
const match = originalText.match(regex);
|
|
459
|
-
if (match) {
|
|
460
|
-
info.thinkContent = match ? match[1].trim() : '';
|
|
461
|
-
info.content = match ? match[2].trim() : '';
|
|
462
|
-
}
|
|
463
|
-
success && success({ message: info, controller, results });
|
|
464
473
|
})
|
|
474
|
+
.then((results) => {
|
|
475
|
+
// 处理请求完成后的信息
|
|
476
|
+
const originalText = info.content;
|
|
477
|
+
const regex = /<think>([\s\S]*?)<\/think>([\s\S]*)/;
|
|
478
|
+
const match = originalText.match(regex);
|
|
479
|
+
if (match) {
|
|
480
|
+
info.thinkContent = match ? match[1].trim() : '';
|
|
481
|
+
info.content = match ? match[2].trim() : '';
|
|
482
|
+
}
|
|
483
|
+
success && success({ message: info, controller, results });
|
|
484
|
+
})
|
|
465
485
|
.catch((results) => {
|
|
466
486
|
// 处理请求完成后的信息
|
|
467
487
|
const originalText = info.content || '';
|
|
@@ -477,12 +497,19 @@ const ajaxStream = function ({ controller, method = 'post', host, url, data, par
|
|
|
477
497
|
console.error('聊天请求出错:', error);
|
|
478
498
|
let errorMessage = '抱歉,发生了一个错误,请稍后再试。';
|
|
479
499
|
if (error.code === 'ERR_NETWORK') {
|
|
480
|
-
errorMessage =
|
|
500
|
+
errorMessage =
|
|
501
|
+
'网络连接错误,请检查服务器是否正在运行或网络连接是否正常。';
|
|
481
502
|
} else if (error.response) {
|
|
482
|
-
errorMessage = `服务器错误 (${error.response.status}): ${
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
503
|
+
errorMessage = `服务器错误 (${error.response.status}): ${
|
|
504
|
+
error.response.data || '未知错误'
|
|
505
|
+
}`;
|
|
506
|
+
}
|
|
507
|
+
fail &&
|
|
508
|
+
fail({
|
|
509
|
+
status: 0,
|
|
510
|
+
message: { role: 'assistant', content: errorMessage },
|
|
511
|
+
controller
|
|
512
|
+
});
|
|
486
513
|
} finally {
|
|
487
514
|
final && final({ status: -1, message: null, controller });
|
|
488
515
|
}
|
|
@@ -569,20 +596,27 @@ const busEmit = function (that, { method, args, opener }) {
|
|
|
569
596
|
return;
|
|
570
597
|
}
|
|
571
598
|
const bus = that ? that.bus || that.$root.Bus || that.$root.$bus : null;
|
|
572
|
-
bus &&
|
|
599
|
+
bus &&
|
|
600
|
+
(Array.isArray(args)
|
|
601
|
+
? bus.$emit(method, ...args)
|
|
602
|
+
: bus.$emit(method, args));
|
|
573
603
|
} else {
|
|
574
604
|
if (win.top !== win.self) {
|
|
575
605
|
const bus = win.$wujie ? win.$wujie.bus : null;
|
|
576
606
|
if (bus) {
|
|
577
|
-
Array.isArray(args)
|
|
578
|
-
|
|
607
|
+
Array.isArray(args)
|
|
608
|
+
? bus.$emit(method, ...args)
|
|
609
|
+
: bus.$emit(method, args);
|
|
579
610
|
} else {
|
|
580
611
|
win.top.postMessage({ method, query: args, args }, '*');
|
|
581
612
|
}
|
|
582
613
|
return;
|
|
583
614
|
}
|
|
584
615
|
const bus = that ? that.bus || that.$root.Bus || that.$root.$bus : null;
|
|
585
|
-
bus &&
|
|
616
|
+
bus &&
|
|
617
|
+
(Array.isArray(args)
|
|
618
|
+
? bus.$emit(method, ...args)
|
|
619
|
+
: bus.$emit(method, args));
|
|
586
620
|
}
|
|
587
621
|
};
|
|
588
622
|
|
|
@@ -860,14 +894,13 @@ const delUrlParam = function ({ url, key }) {
|
|
|
860
894
|
} else {
|
|
861
895
|
if (param.hasOwnProperty(key)) {
|
|
862
896
|
let reg = `${key}=${param[key]}`;
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}
|
|
897
|
+
if (src.indexOf(reg + '&') > -1) {
|
|
898
|
+
src = src.replace(reg + '&', '');
|
|
899
|
+
} else if (src.indexOf('&' + reg) > -1) {
|
|
900
|
+
src = src.replace('&' + reg, '');
|
|
901
|
+
} else {
|
|
902
|
+
src = src.replace(reg, '');
|
|
903
|
+
}
|
|
871
904
|
}
|
|
872
905
|
}
|
|
873
906
|
}
|
|
@@ -1234,7 +1267,7 @@ const formatDate = function (date, fmt) {
|
|
|
1234
1267
|
if (isNaN(obj.getTime())) throw new Error('Invalid date input');
|
|
1235
1268
|
|
|
1236
1269
|
// 2. 工具函数
|
|
1237
|
-
const pad = n => String(n).padStart(2, '0');
|
|
1270
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
1238
1271
|
const monthNum = obj.getMonth(); // 数值月份 (0-11)
|
|
1239
1272
|
|
|
1240
1273
|
// 3. 定义格式化规则
|
|
@@ -1248,7 +1281,7 @@ const formatDate = function (date, fmt) {
|
|
|
1248
1281
|
'm+': obj.getMinutes(), // 分钟 (0-59)
|
|
1249
1282
|
's+': obj.getSeconds(), // 秒 (0-59)
|
|
1250
1283
|
'q+': quarter[Math.floor(monthNum / 3)], // 季度 (一~四)
|
|
1251
|
-
|
|
1284
|
+
S: obj.getMilliseconds() // 毫秒 (0-999)
|
|
1252
1285
|
};
|
|
1253
1286
|
|
|
1254
1287
|
// 4. 处理年份
|
|
@@ -1263,10 +1296,7 @@ const formatDate = function (date, fmt) {
|
|
|
1263
1296
|
for (const k in o) {
|
|
1264
1297
|
if (new RegExp(`(${k})`).test(fmt)) {
|
|
1265
1298
|
const val = k === 'q+' ? o[k] : pad(o[k]); // 季度不补零
|
|
1266
|
-
fmt = fmt.replace(
|
|
1267
|
-
RegExp.$1,
|
|
1268
|
-
RegExp.$1.length === 1 ? o[k] : val
|
|
1269
|
-
);
|
|
1299
|
+
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : val);
|
|
1270
1300
|
}
|
|
1271
1301
|
}
|
|
1272
1302
|
|
|
@@ -1471,7 +1501,7 @@ const getMainConfig = function (callback) {
|
|
|
1471
1501
|
callback(res.results);
|
|
1472
1502
|
}
|
|
1473
1503
|
})
|
|
1474
|
-
.catch(() => {
|
|
1504
|
+
.catch(() => {});
|
|
1475
1505
|
};
|
|
1476
1506
|
|
|
1477
1507
|
/**
|
|
@@ -1790,7 +1820,11 @@ const getTypeName = function (type) {
|
|
|
1790
1820
|
typeName = '[角色]';
|
|
1791
1821
|
} else if (type === 'post') {
|
|
1792
1822
|
typeName = '[岗位]';
|
|
1793
|
-
} else if (
|
|
1823
|
+
} else if (
|
|
1824
|
+
type === 'otheremployee' ||
|
|
1825
|
+
type === 'employee' ||
|
|
1826
|
+
type === 'myemployee'
|
|
1827
|
+
) {
|
|
1794
1828
|
if (sysdepname) {
|
|
1795
1829
|
typeName = '[' + sysdepname + '员工]';
|
|
1796
1830
|
} else {
|
|
@@ -1959,26 +1993,51 @@ const getZoom = function () {
|
|
|
1959
1993
|
|
|
1960
1994
|
const handlerUrl = function (url, param, before) {
|
|
1961
1995
|
let arry = url.split('?');
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
arry.
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1996
|
+
// /archives-ui/webpack/index.html?cookie=1#/fullTextSearch
|
|
1997
|
+
if (arry.length > 1 && arry[1].indexOf('#/') > -1) {
|
|
1998
|
+
// 分割成 arry[0] = /archives-ui/webpack/index.html 和 arry[1] = cookie=1#/fullTextSearch
|
|
1999
|
+
let hashs = arry[1].split('#/'); // 分割成 hashs[0] = cookie=1 和 hashs[1] = fullTextSearch
|
|
2000
|
+
if (hashs[1].indexOf('?') === -1) {
|
|
2001
|
+
hashs[1] += '?_tt=' + new Date().getTime();
|
|
2002
|
+
} else {
|
|
2003
|
+
if (hashs[1].indexOf('_tt') === -1) {
|
|
2004
|
+
hashs[1] += '&_tt=' + new Date().getTime();
|
|
2005
|
+
} else {
|
|
2006
|
+
let search = hashs[1].split('&');
|
|
2007
|
+
for (let i in search) {
|
|
2008
|
+
if (search[i].indexOf('_tt') > -1) {
|
|
2009
|
+
search[i] = '_tt=' + new Date().getTime();
|
|
2010
|
+
}
|
|
1972
2011
|
}
|
|
2012
|
+
hashs[1] = search.join('&');
|
|
1973
2013
|
}
|
|
1974
|
-
arry[1] = search.join('&');
|
|
1975
|
-
} else {
|
|
1976
|
-
arry[1] += '&_tt=' + new Date().getTime();
|
|
1977
2014
|
}
|
|
1978
|
-
|
|
2015
|
+
// /archives-ui/webpack/index.html?cookie=1#/fullTextSearch&_tt=1764839214926&false
|
|
2016
|
+
// 会不会存在 参数中也有#/
|
|
2017
|
+
url = arry[0] + '?' + hashs.join('#/');
|
|
1979
2018
|
} else {
|
|
1980
|
-
|
|
2019
|
+
if (arry.length > 2) {
|
|
2020
|
+
let ary = arry.splice(1, arry.length);
|
|
2021
|
+
arry.push(ary.join('?'));
|
|
2022
|
+
}
|
|
2023
|
+
if (arry.length > 1) {
|
|
2024
|
+
if (arry[1].indexOf('_tt') > -1) {
|
|
2025
|
+
let search = arry[1].split('&');
|
|
2026
|
+
for (let i in search) {
|
|
2027
|
+
if (search[i].indexOf('_tt') > -1) {
|
|
2028
|
+
search[i] = '_tt=' + new Date().getTime();
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
arry[1] = search.join('&');
|
|
2032
|
+
} else {
|
|
2033
|
+
arry[1] += '&_tt=' + new Date().getTime();
|
|
2034
|
+
}
|
|
2035
|
+
url = arry.join('?');
|
|
2036
|
+
} else {
|
|
2037
|
+
url += '?_tt=' + new Date().getTime();
|
|
2038
|
+
}
|
|
1981
2039
|
}
|
|
2040
|
+
|
|
1982
2041
|
if (param) {
|
|
1983
2042
|
let str = queryParams(param);
|
|
1984
2043
|
url += '&' + str;
|
|
@@ -2221,7 +2280,7 @@ const isLogined = async function ({
|
|
|
2221
2280
|
removeStorage();
|
|
2222
2281
|
}
|
|
2223
2282
|
})
|
|
2224
|
-
.catch(() => {
|
|
2283
|
+
.catch(() => {});
|
|
2225
2284
|
return;
|
|
2226
2285
|
}
|
|
2227
2286
|
let pathname = '';
|
|
@@ -2257,7 +2316,11 @@ const isLogined = async function ({
|
|
|
2257
2316
|
Object.prototype.hasOwnProperty.call(to.query, 'serverId') &&
|
|
2258
2317
|
Object.prototype.hasOwnProperty.call(to.query, 'authType')
|
|
2259
2318
|
) {
|
|
2260
|
-
let loadingInstance = Loading.service({
|
|
2319
|
+
let loadingInstance = Loading.service({
|
|
2320
|
+
text: '页面加载中',
|
|
2321
|
+
spinner: 'el-icon-loading',
|
|
2322
|
+
background: 'rgba(0, 0, 0, 0.65)'
|
|
2323
|
+
});
|
|
2261
2324
|
await ajax({
|
|
2262
2325
|
method: 'post',
|
|
2263
2326
|
url: authCenter,
|
|
@@ -2727,10 +2790,7 @@ const responses = function (data) {
|
|
|
2727
2790
|
} catch (error) {
|
|
2728
2791
|
href = win.location.href;
|
|
2729
2792
|
}
|
|
2730
|
-
if (
|
|
2731
|
-
href.indexOf('#/login') === -1 &&
|
|
2732
|
-
href.indexOf('/login.html') === -1
|
|
2733
|
-
) {
|
|
2793
|
+
if (href.indexOf('#/login') === -1 && href.indexOf('/login.html') === -1) {
|
|
2734
2794
|
let remind = sessionStorage.getItem('remind');
|
|
2735
2795
|
if (!remind) {
|
|
2736
2796
|
clearTimeout(loginMsg);
|
|
@@ -2743,16 +2803,16 @@ const responses = function (data) {
|
|
|
2743
2803
|
'提示',
|
|
2744
2804
|
data.rCode === 69
|
|
2745
2805
|
? {
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2806
|
+
confirmButtonText: '确定',
|
|
2807
|
+
closeOnClickModal: false,
|
|
2808
|
+
type: 'warning'
|
|
2809
|
+
}
|
|
2750
2810
|
: {
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2811
|
+
confirmButtonText: '确定',
|
|
2812
|
+
cancelButtonText: '取消',
|
|
2813
|
+
closeOnClickModal: false,
|
|
2814
|
+
type: 'warning'
|
|
2815
|
+
}
|
|
2756
2816
|
)
|
|
2757
2817
|
.then(() => {
|
|
2758
2818
|
try {
|
|
@@ -2774,9 +2834,7 @@ const responses = function (data) {
|
|
|
2774
2834
|
src = loginPage;
|
|
2775
2835
|
}
|
|
2776
2836
|
win.top.location.href = src;
|
|
2777
|
-
} else if (
|
|
2778
|
-
win.top.location.href.indexOf('main.html') > -1
|
|
2779
|
-
) {
|
|
2837
|
+
} else if (win.top.location.href.indexOf('main.html') > -1) {
|
|
2780
2838
|
win.top.location.href = './login.html';
|
|
2781
2839
|
} else {
|
|
2782
2840
|
const hash = win.top.location.hash;
|
|
@@ -2813,9 +2871,7 @@ const responses = function (data) {
|
|
|
2813
2871
|
return h('es-retrial-auth', {
|
|
2814
2872
|
ref: 'auth',
|
|
2815
2873
|
props: {
|
|
2816
|
-
reload:
|
|
2817
|
-
data.results.reload ||
|
|
2818
|
-
data.results.refresh,
|
|
2874
|
+
reload: data.results.reload || data.results.refresh,
|
|
2819
2875
|
group: data.results.retrialAuthGroupIds,
|
|
2820
2876
|
type: data.results.retrialAuthType,
|
|
2821
2877
|
msgBox: msgBox
|
|
@@ -3358,10 +3414,10 @@ const watermark = function (option) {
|
|
|
3358
3414
|
};
|
|
3359
3415
|
let options = option
|
|
3360
3416
|
? extend(
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3417
|
+
true,
|
|
3418
|
+
config,
|
|
3419
|
+
typeof option === 'string' ? { html: option } : option
|
|
3420
|
+
)
|
|
3365
3421
|
: config;
|
|
3366
3422
|
let wrap = document.getElementById('watermark');
|
|
3367
3423
|
if (!wrap) {
|
|
@@ -3523,14 +3579,19 @@ const getStorage = function (key) {
|
|
|
3523
3579
|
let defaults = {};
|
|
3524
3580
|
const token =
|
|
3525
3581
|
sessionStorage.getItem('token') ||
|
|
3526
|
-
localStorage.getItem('token') ||
|
|
3582
|
+
localStorage.getItem('token') ||
|
|
3583
|
+
getCookie('token') ||
|
|
3527
3584
|
win.token;
|
|
3528
3585
|
const ssId =
|
|
3529
|
-
sessionStorage.getItem('ssId') ||
|
|
3586
|
+
sessionStorage.getItem('ssId') ||
|
|
3587
|
+
localStorage.getItem('ssId') ||
|
|
3588
|
+
getCookie('ssId') ||
|
|
3589
|
+
win.ssId;
|
|
3530
3590
|
|
|
3531
3591
|
const deviceUnique =
|
|
3532
3592
|
sessionStorage.getItem('deviceUnique') ||
|
|
3533
|
-
localStorage.getItem('deviceUnique') ||
|
|
3593
|
+
localStorage.getItem('deviceUnique') ||
|
|
3594
|
+
getCookie('deviceUnique') ||
|
|
3534
3595
|
win.deviceUnique;
|
|
3535
3596
|
if (token) {
|
|
3536
3597
|
defaults.Authorization = token;
|
|
@@ -3592,17 +3653,19 @@ const setCookie = function (name, value, isSession = true, time) {
|
|
|
3592
3653
|
if (isIE) {
|
|
3593
3654
|
// IE使用expires
|
|
3594
3655
|
const date = new Date();
|
|
3595
|
-
date.setTime(date.getTime() + (time ||
|
|
3656
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3596
3657
|
cookieParts.push(`expires=${date.toUTCString()}`);
|
|
3597
3658
|
} else {
|
|
3598
3659
|
// 其他浏览器使用max-age
|
|
3599
|
-
cookieParts.push('max-age=' + (time ||
|
|
3660
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3600
3661
|
}
|
|
3601
3662
|
}
|
|
3602
3663
|
// 内核兼容处理
|
|
3603
3664
|
if (isIE) {
|
|
3604
3665
|
// IE特殊处理:添加P3P协议头
|
|
3605
|
-
cookieParts.push(
|
|
3666
|
+
cookieParts.push(
|
|
3667
|
+
'P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'
|
|
3668
|
+
);
|
|
3606
3669
|
} else {
|
|
3607
3670
|
// 现代浏览器设置
|
|
3608
3671
|
cookieParts.push('samesite=lax');
|
|
@@ -3647,10 +3710,14 @@ const getCookie = function (name) {
|
|
|
3647
3710
|
const removeCookie = function (key) {
|
|
3648
3711
|
if (Array.isArray(key)) {
|
|
3649
3712
|
for (let i = 0; i < key.length; i++) {
|
|
3650
|
-
document.cookie = `${encodeURIComponent(
|
|
3713
|
+
document.cookie = `${encodeURIComponent(
|
|
3714
|
+
key[i]
|
|
3715
|
+
)}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
|
|
3651
3716
|
}
|
|
3652
3717
|
} else {
|
|
3653
|
-
document.cookie = `${encodeURIComponent(
|
|
3718
|
+
document.cookie = `${encodeURIComponent(
|
|
3719
|
+
key
|
|
3720
|
+
)}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
|
|
3654
3721
|
}
|
|
3655
3722
|
};
|
|
3656
3723
|
|