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.
Files changed (119) hide show
  1. package/lib/button-group.js +48 -7
  2. package/lib/button.js +48 -7
  3. package/lib/calogin.js +48 -7
  4. package/lib/checkbox-group.js +48 -7
  5. package/lib/data-table-form.js +48 -7
  6. package/lib/data-table.js +48 -7
  7. package/lib/date-picker.js +48 -7
  8. package/lib/dialog.js +48 -7
  9. package/lib/eoss-ui.common.js +608 -525
  10. package/lib/flow-group.js +70 -9
  11. package/lib/flow-list.js +129 -88
  12. package/lib/flow.js +340 -294
  13. package/lib/form.js +48 -7
  14. package/lib/handle-user.js +48 -7
  15. package/lib/handler.js +48 -7
  16. package/lib/icon.js +48 -7
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +48 -7
  19. package/lib/input.js +48 -7
  20. package/lib/login.js +74 -16
  21. package/lib/main.js +176 -135
  22. package/lib/nav.js +48 -7
  23. package/lib/page.js +48 -7
  24. package/lib/pagination.js +48 -7
  25. package/lib/player.js +48 -7
  26. package/lib/qr-code.js +48 -7
  27. package/lib/radio-group.js +48 -7
  28. package/lib/retrial-auth.js +48 -7
  29. package/lib/select-ganged.js +48 -7
  30. package/lib/select.js +48 -7
  31. package/lib/selector-panel.js +48 -7
  32. package/lib/selector.js +48 -7
  33. package/lib/sizer.js +48 -7
  34. package/lib/steps.js +48 -7
  35. package/lib/switch.js +48 -7
  36. package/lib/table-form.js +48 -7
  37. package/lib/tabs.js +48 -7
  38. package/lib/theme-chalk/index.css +1 -1
  39. package/lib/theme-chalk/login.css +1 -1
  40. package/lib/tips.js +48 -7
  41. package/lib/tree-group.js +48 -7
  42. package/lib/tree.js +48 -7
  43. package/lib/upload.js +48 -7
  44. package/lib/utils/util.js +48 -7
  45. package/lib/wujie.js +48 -7
  46. package/lib/wxlogin.js +48 -7
  47. package/package.json +160 -160
  48. package/packages/.DS_Store +0 -0
  49. package/packages/button-group/src/main.vue +346 -346
  50. package/packages/calogin/.DS_Store +0 -0
  51. package/packages/calogin/src/main.vue +412 -412
  52. package/packages/data-table/src/column.vue +988 -988
  53. package/packages/data-table/src/main.vue +1831 -1831
  54. package/packages/date-picker/.DS_Store +0 -0
  55. package/packages/date-picker/src/.DS_Store +0 -0
  56. package/packages/flow/.DS_Store +0 -0
  57. package/packages/flow/src/.DS_Store +0 -0
  58. package/packages/flow/src/component/Circulate.vue +413 -413
  59. package/packages/flow/src/component/CommonOpinions.vue +373 -373
  60. package/packages/flow/src/component/FileList.vue +97 -97
  61. package/packages/flow/src/component/FreeCirculation.vue +240 -240
  62. package/packages/flow/src/component/SendMsg.vue +242 -242
  63. package/packages/flow/src/component/taskUnionExamine.vue +738 -738
  64. package/packages/flow/src/freeStartFlow.vue +2847 -2847
  65. package/packages/flow/src/main.vue +3843 -3843
  66. package/packages/flow/src/processForm.vue +1370 -1366
  67. package/packages/flow/src/processReject.vue +308 -308
  68. package/packages/flow/src/reset.vue +941 -941
  69. package/packages/flow/src/startTaskRead.vue +691 -691
  70. package/packages/flow/src/supervise.vue +159 -159
  71. package/packages/flow-group/src/main.vue +717 -696
  72. package/packages/flow-list/.DS_Store +0 -0
  73. package/packages/flow-list/src/main.vue +1770 -1770
  74. package/packages/form/.DS_Store +0 -0
  75. package/packages/form/src/main.vue +3901 -3901
  76. package/packages/form/src/table.vue +1512 -1512
  77. package/packages/handle-user/src/main.vue +137 -137
  78. package/packages/handler/src/main.vue +496 -496
  79. package/packages/icon/src/main.vue +104 -104
  80. package/packages/login/.DS_Store +0 -0
  81. package/packages/login/src/main.vue +2020 -1994
  82. package/packages/login/src/resetPassword.vue +557 -557
  83. package/packages/main/.DS_Store +0 -0
  84. package/packages/main/src/.DS_Store +0 -0
  85. package/packages/main/src/default/userinfo.vue +502 -502
  86. package/packages/main/src/public/search.vue +464 -464
  87. package/packages/main/src/simplicity/avatar.vue +82 -82
  88. package/packages/main/src/simplicity/handler.vue +263 -263
  89. package/packages/main/src/simplicity/index.vue +2125 -2125
  90. package/packages/main/src/simplicity/user.vue +259 -259
  91. package/packages/main/src/simplicity/userinfo.vue +398 -398
  92. package/packages/menu/.DS_Store +0 -0
  93. package/packages/select/.DS_Store +0 -0
  94. package/packages/select/src/main.vue +782 -782
  95. package/packages/selector/.DS_Store +0 -0
  96. package/packages/selector/src/main.vue +761 -761
  97. package/packages/selector-panel/.DS_Store +0 -0
  98. package/packages/selector-panel/src/main.vue +1027 -1027
  99. package/packages/selector-panel/src/selection.vue +170 -170
  100. package/packages/switch/src/main.vue +170 -170
  101. package/packages/theme-chalk/lib/index.css +1 -1
  102. package/packages/theme-chalk/lib/login.css +1 -1
  103. package/packages/theme-chalk/src/.DS_Store +0 -0
  104. package/packages/theme-chalk/src/flow.scss +351 -351
  105. package/packages/theme-chalk/src/form.scss +501 -501
  106. package/packages/theme-chalk/src/handler.scss +148 -148
  107. package/packages/theme-chalk/src/icon.scss +1817 -1817
  108. package/packages/theme-chalk/src/login.scss +987 -984
  109. package/packages/theme-chalk/src/selector.scss +92 -92
  110. package/packages/theme-chalk/src/simplicity.scss +1366 -1366
  111. package/packages/theme-chalk/src/upload.scss +172 -172
  112. package/packages/upload/.DS_Store +0 -0
  113. package/packages/upload/src/main.vue +1343 -1343
  114. package/src/.DS_Store +0 -0
  115. package/src/config/api.js +315 -315
  116. package/src/index.js +163 -163
  117. package/src/utils/.DS_Store +0 -0
  118. package/src/utils/rules.js +18 -18
  119. package/src/utils/util.js +49 -9
@@ -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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3509
+ * @param {string} [value] cookie值
3510
+ * @param {boolean} [isSession] 是否是会话cookie
3506
3511
  **/
3507
3512
  var setCookie = function setCookie(name, value) {
3508
- // 不设置 expires max-age,默认为会话 Cookie
3509
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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/button.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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3510
+ * @param {string} [value] cookie值
3511
+ * @param {boolean} [isSession] 是否是会话cookie
3507
3512
  **/
3508
3513
  var setCookie = function setCookie(name, value) {
3509
- // 不设置 expires max-age,默认为会话 Cookie
3510
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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/calogin.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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3509
+ * @param {string} [value] cookie值
3510
+ * @param {boolean} [isSession] 是否是会话cookie
3506
3511
  **/
3507
3512
  var setCookie = function setCookie(name, value) {
3508
- // 不设置 expires max-age,默认为会话 Cookie
3509
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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
  /**
@@ -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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3509
+ * @param {string} [value] cookie值
3510
+ * @param {boolean} [isSession] 是否是会话cookie
3506
3511
  **/
3507
3512
  var setCookie = function setCookie(name, value) {
3508
- // 不设置 expires max-age,默认为会话 Cookie
3509
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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
  /**
@@ -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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3509
+ * @param {string} [value] cookie值
3510
+ * @param {boolean} [isSession] 是否是会话cookie
3506
3511
  **/
3507
3512
  var setCookie = function setCookie(name, value) {
3508
- // 不设置 expires max-age,默认为会话 Cookie
3509
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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/data-table.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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3509
+ * @param {string} [value] cookie值
3510
+ * @param {boolean} [isSession] 是否是会话cookie
3506
3511
  **/
3507
3512
  var setCookie = function setCookie(name, value) {
3508
- // 不设置 expires max-age,默认为会话 Cookie
3509
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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
  /**
@@ -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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3510
+ * @param {string} [value] cookie值
3511
+ * @param {boolean} [isSession] 是否是会话cookie
3507
3512
  **/
3508
3513
  var setCookie = function setCookie(name, value) {
3509
- // 不设置 expires max-age,默认为会话 Cookie
3510
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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/dialog.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 && response.headers.authorization !== getStorage('token')) {
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 && ssId !== getStorage('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
- * @return {string} [value] cookie值
3509
+ * @param {string} [value] cookie值
3510
+ * @param {boolean} [isSession] 是否是会话cookie
3506
3511
  **/
3507
3512
  var setCookie = function setCookie(name, value) {
3508
- // 不设置 expires max-age,默认为会话 Cookie
3509
- document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + '; path=/';
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
  /**