eoss-ui 0.7.22 → 0.7.24
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 +48 -7
- package/lib/button.js +48 -7
- package/lib/calogin.js +48 -7
- package/lib/checkbox-group.js +48 -7
- package/lib/data-table-form.js +48 -7
- package/lib/data-table.js +48 -7
- package/lib/date-picker.js +48 -7
- package/lib/dialog.js +48 -7
- package/lib/eoss-ui.common.js +608 -525
- package/lib/flow-group.js +70 -9
- package/lib/flow-list.js +129 -88
- package/lib/flow.js +340 -294
- package/lib/form.js +48 -7
- package/lib/handle-user.js +48 -7
- package/lib/handler.js +48 -7
- package/lib/icon.js +48 -7
- package/lib/index.js +1 -1
- package/lib/input-number.js +48 -7
- package/lib/input.js +48 -7
- package/lib/login.js +74 -16
- package/lib/main.js +176 -135
- package/lib/nav.js +48 -7
- package/lib/page.js +48 -7
- package/lib/pagination.js +48 -7
- package/lib/player.js +48 -7
- package/lib/qr-code.js +48 -7
- package/lib/radio-group.js +48 -7
- package/lib/retrial-auth.js +48 -7
- package/lib/select-ganged.js +48 -7
- package/lib/select.js +48 -7
- package/lib/selector-panel.js +48 -7
- package/lib/selector.js +48 -7
- package/lib/sizer.js +48 -7
- package/lib/steps.js +48 -7
- package/lib/switch.js +48 -7
- package/lib/table-form.js +48 -7
- package/lib/tabs.js +48 -7
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/tips.js +48 -7
- package/lib/tree-group.js +48 -7
- package/lib/tree.js +48 -7
- package/lib/upload.js +48 -7
- package/lib/utils/util.js +48 -7
- package/lib/wujie.js +48 -7
- package/lib/wxlogin.js +48 -7
- package/package.json +160 -160
- package/packages/.DS_Store +0 -0
- package/packages/button-group/src/main.vue +346 -346
- package/packages/calogin/.DS_Store +0 -0
- package/packages/calogin/src/main.vue +412 -412
- package/packages/data-table/src/column.vue +988 -988
- package/packages/data-table/src/main.vue +1831 -1831
- package/packages/date-picker/.DS_Store +0 -0
- package/packages/date-picker/src/.DS_Store +0 -0
- package/packages/flow/.DS_Store +0 -0
- package/packages/flow/src/.DS_Store +0 -0
- package/packages/flow/src/component/Circulate.vue +413 -413
- package/packages/flow/src/component/CommonOpinions.vue +373 -373
- package/packages/flow/src/component/FileList.vue +97 -97
- package/packages/flow/src/component/FreeCirculation.vue +240 -240
- package/packages/flow/src/component/SendMsg.vue +242 -242
- package/packages/flow/src/component/taskUnionExamine.vue +738 -738
- package/packages/flow/src/freeStartFlow.vue +2847 -2847
- package/packages/flow/src/main.vue +3843 -3843
- package/packages/flow/src/processForm.vue +1370 -1366
- package/packages/flow/src/processReject.vue +308 -308
- package/packages/flow/src/reset.vue +941 -941
- package/packages/flow/src/startTaskRead.vue +691 -691
- package/packages/flow/src/supervise.vue +159 -159
- package/packages/flow-group/src/main.vue +717 -696
- package/packages/flow-list/.DS_Store +0 -0
- package/packages/flow-list/src/main.vue +1770 -1770
- package/packages/form/.DS_Store +0 -0
- package/packages/form/src/main.vue +3901 -3901
- package/packages/form/src/table.vue +1512 -1512
- package/packages/handle-user/src/main.vue +137 -137
- package/packages/handler/src/main.vue +496 -496
- package/packages/icon/src/main.vue +104 -104
- package/packages/login/.DS_Store +0 -0
- package/packages/login/src/main.vue +2020 -1994
- package/packages/login/src/resetPassword.vue +557 -557
- package/packages/main/.DS_Store +0 -0
- package/packages/main/src/.DS_Store +0 -0
- package/packages/main/src/default/userinfo.vue +502 -502
- package/packages/main/src/public/search.vue +464 -464
- package/packages/main/src/simplicity/avatar.vue +82 -82
- package/packages/main/src/simplicity/handler.vue +263 -263
- package/packages/main/src/simplicity/index.vue +2125 -2125
- package/packages/main/src/simplicity/user.vue +259 -259
- package/packages/main/src/simplicity/userinfo.vue +398 -398
- package/packages/menu/.DS_Store +0 -0
- package/packages/select/.DS_Store +0 -0
- package/packages/select/src/main.vue +782 -782
- package/packages/selector/.DS_Store +0 -0
- package/packages/selector/src/main.vue +761 -761
- package/packages/selector-panel/.DS_Store +0 -0
- package/packages/selector-panel/src/main.vue +1027 -1027
- package/packages/selector-panel/src/selection.vue +170 -170
- package/packages/switch/src/main.vue +170 -170
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/login.css +1 -1
- package/packages/theme-chalk/src/.DS_Store +0 -0
- package/packages/theme-chalk/src/flow.scss +351 -351
- package/packages/theme-chalk/src/form.scss +501 -501
- package/packages/theme-chalk/src/handler.scss +148 -148
- package/packages/theme-chalk/src/icon.scss +1817 -1817
- package/packages/theme-chalk/src/login.scss +987 -984
- package/packages/theme-chalk/src/selector.scss +92 -92
- package/packages/theme-chalk/src/simplicity.scss +1366 -1366
- package/packages/theme-chalk/src/upload.scss +172 -172
- package/packages/upload/.DS_Store +0 -0
- package/packages/upload/src/main.vue +1343 -1343
- package/src/.DS_Store +0 -0
- package/src/config/api.js +315 -315
- package/src/index.js +163 -163
- package/src/utils/.DS_Store +0 -0
- package/src/utils/rules.js +18 -18
- package/src/utils/util.js +49 -9
package/lib/selector-panel.js
CHANGED
|
@@ -242,16 +242,17 @@ var ajax = function ajax(_ref) {
|
|
|
242
242
|
http.interceptors.response.use(function (response) {
|
|
243
243
|
// delPendingRequest(response.config);
|
|
244
244
|
loading && loading.close();
|
|
245
|
-
if (response.headers.authorization
|
|
246
|
-
setStorage({
|
|
245
|
+
if (response.headers.authorization) {
|
|
246
|
+
response.headers.authorization !== getStorage('token') && setStorage({
|
|
247
|
+
|
|
247
248
|
key: ['token', 'Authorization'],
|
|
248
249
|
value: response.headers.authorization
|
|
249
250
|
});
|
|
250
251
|
}
|
|
251
252
|
var ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
|
|
252
253
|
|
|
253
|
-
if (ssId
|
|
254
|
-
setStorage({
|
|
254
|
+
if (ssId) {
|
|
255
|
+
ssId !== getStorage('ssId') && setStorage({
|
|
255
256
|
key: 'ssId',
|
|
256
257
|
value: ssId
|
|
257
258
|
});
|
|
@@ -3449,6 +3450,9 @@ var getStorage = function getStorage(key) {
|
|
|
3449
3450
|
if (key === 'host' && !res) {
|
|
3450
3451
|
return win.location.origin;
|
|
3451
3452
|
}
|
|
3453
|
+
if (!res && key === 'token') {
|
|
3454
|
+
res = getCookie('token');
|
|
3455
|
+
}
|
|
3452
3456
|
return res;
|
|
3453
3457
|
}
|
|
3454
3458
|
var defaults = {};
|
|
@@ -3502,11 +3506,48 @@ var removeStorage = function removeStorage(key) {
|
|
|
3502
3506
|
* @desc 设置cookie
|
|
3503
3507
|
* @author huangbo
|
|
3504
3508
|
* @param {string} [name] cookie名称
|
|
3505
|
-
* @
|
|
3509
|
+
* @param {string} [value] cookie值
|
|
3510
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
3506
3511
|
**/
|
|
3507
3512
|
var setCookie = function setCookie(name, value) {
|
|
3508
|
-
|
|
3509
|
-
|
|
3513
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3514
|
+
var time = arguments[3];
|
|
3515
|
+
|
|
3516
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
3517
|
+
try {
|
|
3518
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3519
|
+
];
|
|
3520
|
+
// 会话/持久Cookie设置
|
|
3521
|
+
if (!isSession) {
|
|
3522
|
+
if (isIE) {
|
|
3523
|
+
// IE使用expires
|
|
3524
|
+
var date = new Date();
|
|
3525
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3526
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
3527
|
+
} else {
|
|
3528
|
+
// 其他浏览器使用max-age
|
|
3529
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3530
|
+
}
|
|
3531
|
+
}
|
|
3532
|
+
// 内核兼容处理
|
|
3533
|
+
if (isIE) {
|
|
3534
|
+
// IE特殊处理:添加P3P协议头
|
|
3535
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3536
|
+
} else {
|
|
3537
|
+
// 现代浏览器设置
|
|
3538
|
+
cookieParts.push('samesite=lax');
|
|
3539
|
+
if (window.location.protocol === 'https:') {
|
|
3540
|
+
cookieParts.push('secure');
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
// 设置Cookie
|
|
3545
|
+
document.cookie = cookieParts.join('; ');
|
|
3546
|
+
return true;
|
|
3547
|
+
} catch (e) {
|
|
3548
|
+
console.error('Cookie设置失败:', e);
|
|
3549
|
+
return false;
|
|
3550
|
+
}
|
|
3510
3551
|
};
|
|
3511
3552
|
|
|
3512
3553
|
/**
|
package/lib/selector.js
CHANGED
|
@@ -243,16 +243,17 @@ var ajax = function ajax(_ref) {
|
|
|
243
243
|
http.interceptors.response.use(function (response) {
|
|
244
244
|
// delPendingRequest(response.config);
|
|
245
245
|
loading && loading.close();
|
|
246
|
-
if (response.headers.authorization
|
|
247
|
-
setStorage({
|
|
246
|
+
if (response.headers.authorization) {
|
|
247
|
+
response.headers.authorization !== getStorage('token') && setStorage({
|
|
248
|
+
|
|
248
249
|
key: ['token', 'Authorization'],
|
|
249
250
|
value: response.headers.authorization
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
var ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
|
|
253
254
|
|
|
254
|
-
if (ssId
|
|
255
|
-
setStorage({
|
|
255
|
+
if (ssId) {
|
|
256
|
+
ssId !== getStorage('ssId') && setStorage({
|
|
256
257
|
key: 'ssId',
|
|
257
258
|
value: ssId
|
|
258
259
|
});
|
|
@@ -3450,6 +3451,9 @@ var getStorage = function getStorage(key) {
|
|
|
3450
3451
|
if (key === 'host' && !res) {
|
|
3451
3452
|
return win.location.origin;
|
|
3452
3453
|
}
|
|
3454
|
+
if (!res && key === 'token') {
|
|
3455
|
+
res = getCookie('token');
|
|
3456
|
+
}
|
|
3453
3457
|
return res;
|
|
3454
3458
|
}
|
|
3455
3459
|
var defaults = {};
|
|
@@ -3503,11 +3507,48 @@ var removeStorage = function removeStorage(key) {
|
|
|
3503
3507
|
* @desc 设置cookie
|
|
3504
3508
|
* @author huangbo
|
|
3505
3509
|
* @param {string} [name] cookie名称
|
|
3506
|
-
* @
|
|
3510
|
+
* @param {string} [value] cookie值
|
|
3511
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
3507
3512
|
**/
|
|
3508
3513
|
var setCookie = function setCookie(name, value) {
|
|
3509
|
-
|
|
3510
|
-
|
|
3514
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3515
|
+
var time = arguments[3];
|
|
3516
|
+
|
|
3517
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
3518
|
+
try {
|
|
3519
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3520
|
+
];
|
|
3521
|
+
// 会话/持久Cookie设置
|
|
3522
|
+
if (!isSession) {
|
|
3523
|
+
if (isIE) {
|
|
3524
|
+
// IE使用expires
|
|
3525
|
+
var date = new Date();
|
|
3526
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3527
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
3528
|
+
} else {
|
|
3529
|
+
// 其他浏览器使用max-age
|
|
3530
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
// 内核兼容处理
|
|
3534
|
+
if (isIE) {
|
|
3535
|
+
// IE特殊处理:添加P3P协议头
|
|
3536
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3537
|
+
} else {
|
|
3538
|
+
// 现代浏览器设置
|
|
3539
|
+
cookieParts.push('samesite=lax');
|
|
3540
|
+
if (window.location.protocol === 'https:') {
|
|
3541
|
+
cookieParts.push('secure');
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
// 设置Cookie
|
|
3546
|
+
document.cookie = cookieParts.join('; ');
|
|
3547
|
+
return true;
|
|
3548
|
+
} catch (e) {
|
|
3549
|
+
console.error('Cookie设置失败:', e);
|
|
3550
|
+
return false;
|
|
3551
|
+
}
|
|
3511
3552
|
};
|
|
3512
3553
|
|
|
3513
3554
|
/**
|
package/lib/sizer.js
CHANGED
|
@@ -243,16 +243,17 @@ var ajax = function ajax(_ref) {
|
|
|
243
243
|
http.interceptors.response.use(function (response) {
|
|
244
244
|
// delPendingRequest(response.config);
|
|
245
245
|
loading && loading.close();
|
|
246
|
-
if (response.headers.authorization
|
|
247
|
-
setStorage({
|
|
246
|
+
if (response.headers.authorization) {
|
|
247
|
+
response.headers.authorization !== getStorage('token') && setStorage({
|
|
248
|
+
|
|
248
249
|
key: ['token', 'Authorization'],
|
|
249
250
|
value: response.headers.authorization
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
var ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
|
|
253
254
|
|
|
254
|
-
if (ssId
|
|
255
|
-
setStorage({
|
|
255
|
+
if (ssId) {
|
|
256
|
+
ssId !== getStorage('ssId') && setStorage({
|
|
256
257
|
key: 'ssId',
|
|
257
258
|
value: ssId
|
|
258
259
|
});
|
|
@@ -3450,6 +3451,9 @@ var getStorage = function getStorage(key) {
|
|
|
3450
3451
|
if (key === 'host' && !res) {
|
|
3451
3452
|
return win.location.origin;
|
|
3452
3453
|
}
|
|
3454
|
+
if (!res && key === 'token') {
|
|
3455
|
+
res = getCookie('token');
|
|
3456
|
+
}
|
|
3453
3457
|
return res;
|
|
3454
3458
|
}
|
|
3455
3459
|
var defaults = {};
|
|
@@ -3503,11 +3507,48 @@ var removeStorage = function removeStorage(key) {
|
|
|
3503
3507
|
* @desc 设置cookie
|
|
3504
3508
|
* @author huangbo
|
|
3505
3509
|
* @param {string} [name] cookie名称
|
|
3506
|
-
* @
|
|
3510
|
+
* @param {string} [value] cookie值
|
|
3511
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
3507
3512
|
**/
|
|
3508
3513
|
var setCookie = function setCookie(name, value) {
|
|
3509
|
-
|
|
3510
|
-
|
|
3514
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3515
|
+
var time = arguments[3];
|
|
3516
|
+
|
|
3517
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
3518
|
+
try {
|
|
3519
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3520
|
+
];
|
|
3521
|
+
// 会话/持久Cookie设置
|
|
3522
|
+
if (!isSession) {
|
|
3523
|
+
if (isIE) {
|
|
3524
|
+
// IE使用expires
|
|
3525
|
+
var date = new Date();
|
|
3526
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3527
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
3528
|
+
} else {
|
|
3529
|
+
// 其他浏览器使用max-age
|
|
3530
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
// 内核兼容处理
|
|
3534
|
+
if (isIE) {
|
|
3535
|
+
// IE特殊处理:添加P3P协议头
|
|
3536
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3537
|
+
} else {
|
|
3538
|
+
// 现代浏览器设置
|
|
3539
|
+
cookieParts.push('samesite=lax');
|
|
3540
|
+
if (window.location.protocol === 'https:') {
|
|
3541
|
+
cookieParts.push('secure');
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
// 设置Cookie
|
|
3546
|
+
document.cookie = cookieParts.join('; ');
|
|
3547
|
+
return true;
|
|
3548
|
+
} catch (e) {
|
|
3549
|
+
console.error('Cookie设置失败:', e);
|
|
3550
|
+
return false;
|
|
3551
|
+
}
|
|
3511
3552
|
};
|
|
3512
3553
|
|
|
3513
3554
|
/**
|
package/lib/steps.js
CHANGED
|
@@ -243,16 +243,17 @@ var ajax = function ajax(_ref) {
|
|
|
243
243
|
http.interceptors.response.use(function (response) {
|
|
244
244
|
// delPendingRequest(response.config);
|
|
245
245
|
loading && loading.close();
|
|
246
|
-
if (response.headers.authorization
|
|
247
|
-
setStorage({
|
|
246
|
+
if (response.headers.authorization) {
|
|
247
|
+
response.headers.authorization !== getStorage('token') && setStorage({
|
|
248
|
+
|
|
248
249
|
key: ['token', 'Authorization'],
|
|
249
250
|
value: response.headers.authorization
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
var ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
|
|
253
254
|
|
|
254
|
-
if (ssId
|
|
255
|
-
setStorage({
|
|
255
|
+
if (ssId) {
|
|
256
|
+
ssId !== getStorage('ssId') && setStorage({
|
|
256
257
|
key: 'ssId',
|
|
257
258
|
value: ssId
|
|
258
259
|
});
|
|
@@ -3450,6 +3451,9 @@ var getStorage = function getStorage(key) {
|
|
|
3450
3451
|
if (key === 'host' && !res) {
|
|
3451
3452
|
return win.location.origin;
|
|
3452
3453
|
}
|
|
3454
|
+
if (!res && key === 'token') {
|
|
3455
|
+
res = getCookie('token');
|
|
3456
|
+
}
|
|
3453
3457
|
return res;
|
|
3454
3458
|
}
|
|
3455
3459
|
var defaults = {};
|
|
@@ -3503,11 +3507,48 @@ var removeStorage = function removeStorage(key) {
|
|
|
3503
3507
|
* @desc 设置cookie
|
|
3504
3508
|
* @author huangbo
|
|
3505
3509
|
* @param {string} [name] cookie名称
|
|
3506
|
-
* @
|
|
3510
|
+
* @param {string} [value] cookie值
|
|
3511
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
3507
3512
|
**/
|
|
3508
3513
|
var setCookie = function setCookie(name, value) {
|
|
3509
|
-
|
|
3510
|
-
|
|
3514
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3515
|
+
var time = arguments[3];
|
|
3516
|
+
|
|
3517
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
3518
|
+
try {
|
|
3519
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3520
|
+
];
|
|
3521
|
+
// 会话/持久Cookie设置
|
|
3522
|
+
if (!isSession) {
|
|
3523
|
+
if (isIE) {
|
|
3524
|
+
// IE使用expires
|
|
3525
|
+
var date = new Date();
|
|
3526
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3527
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
3528
|
+
} else {
|
|
3529
|
+
// 其他浏览器使用max-age
|
|
3530
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
// 内核兼容处理
|
|
3534
|
+
if (isIE) {
|
|
3535
|
+
// IE特殊处理:添加P3P协议头
|
|
3536
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3537
|
+
} else {
|
|
3538
|
+
// 现代浏览器设置
|
|
3539
|
+
cookieParts.push('samesite=lax');
|
|
3540
|
+
if (window.location.protocol === 'https:') {
|
|
3541
|
+
cookieParts.push('secure');
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
// 设置Cookie
|
|
3546
|
+
document.cookie = cookieParts.join('; ');
|
|
3547
|
+
return true;
|
|
3548
|
+
} catch (e) {
|
|
3549
|
+
console.error('Cookie设置失败:', e);
|
|
3550
|
+
return false;
|
|
3551
|
+
}
|
|
3511
3552
|
};
|
|
3512
3553
|
|
|
3513
3554
|
/**
|
package/lib/switch.js
CHANGED
|
@@ -243,16 +243,17 @@ var ajax = function ajax(_ref) {
|
|
|
243
243
|
http.interceptors.response.use(function (response) {
|
|
244
244
|
// delPendingRequest(response.config);
|
|
245
245
|
loading && loading.close();
|
|
246
|
-
if (response.headers.authorization
|
|
247
|
-
setStorage({
|
|
246
|
+
if (response.headers.authorization) {
|
|
247
|
+
response.headers.authorization !== getStorage('token') && setStorage({
|
|
248
|
+
|
|
248
249
|
key: ['token', 'Authorization'],
|
|
249
250
|
value: response.headers.authorization
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
var ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
|
|
253
254
|
|
|
254
|
-
if (ssId
|
|
255
|
-
setStorage({
|
|
255
|
+
if (ssId) {
|
|
256
|
+
ssId !== getStorage('ssId') && setStorage({
|
|
256
257
|
key: 'ssId',
|
|
257
258
|
value: ssId
|
|
258
259
|
});
|
|
@@ -3450,6 +3451,9 @@ var getStorage = function getStorage(key) {
|
|
|
3450
3451
|
if (key === 'host' && !res) {
|
|
3451
3452
|
return win.location.origin;
|
|
3452
3453
|
}
|
|
3454
|
+
if (!res && key === 'token') {
|
|
3455
|
+
res = getCookie('token');
|
|
3456
|
+
}
|
|
3453
3457
|
return res;
|
|
3454
3458
|
}
|
|
3455
3459
|
var defaults = {};
|
|
@@ -3503,11 +3507,48 @@ var removeStorage = function removeStorage(key) {
|
|
|
3503
3507
|
* @desc 设置cookie
|
|
3504
3508
|
* @author huangbo
|
|
3505
3509
|
* @param {string} [name] cookie名称
|
|
3506
|
-
* @
|
|
3510
|
+
* @param {string} [value] cookie值
|
|
3511
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
3507
3512
|
**/
|
|
3508
3513
|
var setCookie = function setCookie(name, value) {
|
|
3509
|
-
|
|
3510
|
-
|
|
3514
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3515
|
+
var time = arguments[3];
|
|
3516
|
+
|
|
3517
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
3518
|
+
try {
|
|
3519
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3520
|
+
];
|
|
3521
|
+
// 会话/持久Cookie设置
|
|
3522
|
+
if (!isSession) {
|
|
3523
|
+
if (isIE) {
|
|
3524
|
+
// IE使用expires
|
|
3525
|
+
var date = new Date();
|
|
3526
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3527
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
3528
|
+
} else {
|
|
3529
|
+
// 其他浏览器使用max-age
|
|
3530
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
// 内核兼容处理
|
|
3534
|
+
if (isIE) {
|
|
3535
|
+
// IE特殊处理:添加P3P协议头
|
|
3536
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3537
|
+
} else {
|
|
3538
|
+
// 现代浏览器设置
|
|
3539
|
+
cookieParts.push('samesite=lax');
|
|
3540
|
+
if (window.location.protocol === 'https:') {
|
|
3541
|
+
cookieParts.push('secure');
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
// 设置Cookie
|
|
3546
|
+
document.cookie = cookieParts.join('; ');
|
|
3547
|
+
return true;
|
|
3548
|
+
} catch (e) {
|
|
3549
|
+
console.error('Cookie设置失败:', e);
|
|
3550
|
+
return false;
|
|
3551
|
+
}
|
|
3511
3552
|
};
|
|
3512
3553
|
|
|
3513
3554
|
/**
|
package/lib/table-form.js
CHANGED
|
@@ -243,16 +243,17 @@ var ajax = function ajax(_ref) {
|
|
|
243
243
|
http.interceptors.response.use(function (response) {
|
|
244
244
|
// delPendingRequest(response.config);
|
|
245
245
|
loading && loading.close();
|
|
246
|
-
if (response.headers.authorization
|
|
247
|
-
setStorage({
|
|
246
|
+
if (response.headers.authorization) {
|
|
247
|
+
response.headers.authorization !== getStorage('token') && setStorage({
|
|
248
|
+
|
|
248
249
|
key: ['token', 'Authorization'],
|
|
249
250
|
value: response.headers.authorization
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
var ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
|
|
253
254
|
|
|
254
|
-
if (ssId
|
|
255
|
-
setStorage({
|
|
255
|
+
if (ssId) {
|
|
256
|
+
ssId !== getStorage('ssId') && setStorage({
|
|
256
257
|
key: 'ssId',
|
|
257
258
|
value: ssId
|
|
258
259
|
});
|
|
@@ -3450,6 +3451,9 @@ var getStorage = function getStorage(key) {
|
|
|
3450
3451
|
if (key === 'host' && !res) {
|
|
3451
3452
|
return win.location.origin;
|
|
3452
3453
|
}
|
|
3454
|
+
if (!res && key === 'token') {
|
|
3455
|
+
res = getCookie('token');
|
|
3456
|
+
}
|
|
3453
3457
|
return res;
|
|
3454
3458
|
}
|
|
3455
3459
|
var defaults = {};
|
|
@@ -3503,11 +3507,48 @@ var removeStorage = function removeStorage(key) {
|
|
|
3503
3507
|
* @desc 设置cookie
|
|
3504
3508
|
* @author huangbo
|
|
3505
3509
|
* @param {string} [name] cookie名称
|
|
3506
|
-
* @
|
|
3510
|
+
* @param {string} [value] cookie值
|
|
3511
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
3507
3512
|
**/
|
|
3508
3513
|
var setCookie = function setCookie(name, value) {
|
|
3509
|
-
|
|
3510
|
-
|
|
3514
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3515
|
+
var time = arguments[3];
|
|
3516
|
+
|
|
3517
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
3518
|
+
try {
|
|
3519
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3520
|
+
];
|
|
3521
|
+
// 会话/持久Cookie设置
|
|
3522
|
+
if (!isSession) {
|
|
3523
|
+
if (isIE) {
|
|
3524
|
+
// IE使用expires
|
|
3525
|
+
var date = new Date();
|
|
3526
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3527
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
3528
|
+
} else {
|
|
3529
|
+
// 其他浏览器使用max-age
|
|
3530
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
// 内核兼容处理
|
|
3534
|
+
if (isIE) {
|
|
3535
|
+
// IE特殊处理:添加P3P协议头
|
|
3536
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3537
|
+
} else {
|
|
3538
|
+
// 现代浏览器设置
|
|
3539
|
+
cookieParts.push('samesite=lax');
|
|
3540
|
+
if (window.location.protocol === 'https:') {
|
|
3541
|
+
cookieParts.push('secure');
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
// 设置Cookie
|
|
3546
|
+
document.cookie = cookieParts.join('; ');
|
|
3547
|
+
return true;
|
|
3548
|
+
} catch (e) {
|
|
3549
|
+
console.error('Cookie设置失败:', e);
|
|
3550
|
+
return false;
|
|
3551
|
+
}
|
|
3511
3552
|
};
|
|
3512
3553
|
|
|
3513
3554
|
/**
|
package/lib/tabs.js
CHANGED
|
@@ -243,16 +243,17 @@ var ajax = function ajax(_ref) {
|
|
|
243
243
|
http.interceptors.response.use(function (response) {
|
|
244
244
|
// delPendingRequest(response.config);
|
|
245
245
|
loading && loading.close();
|
|
246
|
-
if (response.headers.authorization
|
|
247
|
-
setStorage({
|
|
246
|
+
if (response.headers.authorization) {
|
|
247
|
+
response.headers.authorization !== getStorage('token') && setStorage({
|
|
248
|
+
|
|
248
249
|
key: ['token', 'Authorization'],
|
|
249
250
|
value: response.headers.authorization
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
253
|
var ssId = response.headers.ssId || response.headers.Ssid || response.headers.ssid;
|
|
253
254
|
|
|
254
|
-
if (ssId
|
|
255
|
-
setStorage({
|
|
255
|
+
if (ssId) {
|
|
256
|
+
ssId !== getStorage('ssId') && setStorage({
|
|
256
257
|
key: 'ssId',
|
|
257
258
|
value: ssId
|
|
258
259
|
});
|
|
@@ -3450,6 +3451,9 @@ var getStorage = function getStorage(key) {
|
|
|
3450
3451
|
if (key === 'host' && !res) {
|
|
3451
3452
|
return win.location.origin;
|
|
3452
3453
|
}
|
|
3454
|
+
if (!res && key === 'token') {
|
|
3455
|
+
res = getCookie('token');
|
|
3456
|
+
}
|
|
3453
3457
|
return res;
|
|
3454
3458
|
}
|
|
3455
3459
|
var defaults = {};
|
|
@@ -3503,11 +3507,48 @@ var removeStorage = function removeStorage(key) {
|
|
|
3503
3507
|
* @desc 设置cookie
|
|
3504
3508
|
* @author huangbo
|
|
3505
3509
|
* @param {string} [name] cookie名称
|
|
3506
|
-
* @
|
|
3510
|
+
* @param {string} [value] cookie值
|
|
3511
|
+
* @param {boolean} [isSession] 是否是会话cookie
|
|
3507
3512
|
**/
|
|
3508
3513
|
var setCookie = function setCookie(name, value) {
|
|
3509
|
-
|
|
3510
|
-
|
|
3514
|
+
var isSession = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3515
|
+
var time = arguments[3];
|
|
3516
|
+
|
|
3517
|
+
var isIE = /MSIE|Trident/.test(navigator.userAgent);
|
|
3518
|
+
try {
|
|
3519
|
+
var cookieParts = [encodeURIComponent(name) + '=' + encodeURIComponent(value), 'path=/' // 仅保留path设置,确保全站访问
|
|
3520
|
+
];
|
|
3521
|
+
// 会话/持久Cookie设置
|
|
3522
|
+
if (!isSession) {
|
|
3523
|
+
if (isIE) {
|
|
3524
|
+
// IE使用expires
|
|
3525
|
+
var date = new Date();
|
|
3526
|
+
date.setTime(date.getTime() + (time || 7 * 24 * 60 * 60 * 1000));
|
|
3527
|
+
cookieParts.push('expires=' + date.toUTCString());
|
|
3528
|
+
} else {
|
|
3529
|
+
// 其他浏览器使用max-age
|
|
3530
|
+
cookieParts.push('max-age=' + (time || 7 * 24 * 60 * 60));
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
// 内核兼容处理
|
|
3534
|
+
if (isIE) {
|
|
3535
|
+
// IE特殊处理:添加P3P协议头
|
|
3536
|
+
cookieParts.push('P3P=CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
|
|
3537
|
+
} else {
|
|
3538
|
+
// 现代浏览器设置
|
|
3539
|
+
cookieParts.push('samesite=lax');
|
|
3540
|
+
if (window.location.protocol === 'https:') {
|
|
3541
|
+
cookieParts.push('secure');
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
// 设置Cookie
|
|
3546
|
+
document.cookie = cookieParts.join('; ');
|
|
3547
|
+
return true;
|
|
3548
|
+
} catch (e) {
|
|
3549
|
+
console.error('Cookie设置失败:', e);
|
|
3550
|
+
return false;
|
|
3551
|
+
}
|
|
3511
3552
|
};
|
|
3512
3553
|
|
|
3513
3554
|
/**
|