eoss-ui 0.4.98 → 0.5.10

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 (56) hide show
  1. package/lib/button-group.js +117 -27
  2. package/lib/button.js +118 -28
  3. package/lib/checkbox-group.js +198 -96
  4. package/lib/data-table-form.js +117 -31
  5. package/lib/data-table.js +173 -75
  6. package/lib/date-picker.js +117 -27
  7. package/lib/dialog.js +127 -41
  8. package/lib/eoss-ui.common.js +1006 -707
  9. package/lib/flow-group.js +117 -27
  10. package/lib/flow-list.js +136 -36
  11. package/lib/flow.js +147 -41
  12. package/lib/form.js +682 -434
  13. package/lib/handle-user.js +142 -52
  14. package/lib/handler.js +117 -27
  15. package/lib/icons.js +2 -2
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +118 -28
  18. package/lib/input.js +120 -30
  19. package/lib/layout.js +2 -2
  20. package/lib/login.js +123 -36
  21. package/lib/main.js +232 -151
  22. package/lib/nav.js +117 -27
  23. package/lib/page.js +117 -27
  24. package/lib/player.js +119 -29
  25. package/lib/qr-code.js +117 -27
  26. package/lib/radio-group.js +146 -54
  27. package/lib/retrial-auth.js +117 -27
  28. package/lib/select-ganged.js +118 -28
  29. package/lib/select.js +142 -52
  30. package/lib/selector-panel.js +171 -74
  31. package/lib/selector.js +117 -27
  32. package/lib/sizer.js +120 -30
  33. package/lib/steps.js +117 -27
  34. package/lib/switch.js +118 -28
  35. package/lib/table-form.js +182 -76
  36. package/lib/tabs.js +117 -27
  37. package/lib/tips.js +117 -27
  38. package/lib/tree-group.js +117 -27
  39. package/lib/tree.js +117 -27
  40. package/lib/upload.js +206 -109
  41. package/lib/utils/util.js +97 -19
  42. package/lib/wujie.js +117 -27
  43. package/lib/wxlogin.js +117 -27
  44. package/package.json +1 -1
  45. package/packages/button/src/main.vue +1 -10
  46. package/packages/data-table/src/column.vue +6 -0
  47. package/packages/flow/src/main.vue +20 -3
  48. package/packages/flow-list/src/main.vue +4 -3
  49. package/packages/form/src/main.vue +60 -1
  50. package/packages/form/src/table.vue +6 -0
  51. package/packages/login/src/main.vue +1 -0
  52. package/packages/main/src/main.vue +117 -97
  53. package/packages/radio-group/src/main.vue +1 -0
  54. package/packages/upload/src/main.vue +0 -1
  55. package/src/index.js +1 -1
  56. package/src/utils/util.js +94 -20
package/lib/sizer.js CHANGED
@@ -98,8 +98,14 @@ module.exports =
98
98
  /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_2__);
99
99
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
100
100
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(json_bigint__WEBPACK_IMPORTED_MODULE_3__);
101
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
102
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_4__);
101
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
102
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_4__);
103
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
104
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_5__);
105
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
106
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_6__);
107
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
108
+
103
109
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
104
110
 
105
111
  /**
@@ -110,7 +116,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
110
116
  **/
111
117
 
112
118
  /* eslint-disable indent */
113
- var sm2 = __webpack_require__(7).sm2;
119
+ var sm2 = __webpack_require__(9).sm2;
120
+
121
+
114
122
 
115
123
 
116
124
 
@@ -257,7 +265,7 @@ var ajax = function ajax(_ref) {
257
265
  clearTimeout(loginMsg);
258
266
  loginMsg = setTimeout(function () {
259
267
  sessionStorage.setItem('remind', 1);
260
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
268
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
261
269
  confirmButtonText: '确定',
262
270
  closeOnClickModal: false,
263
271
  type: 'warning'
@@ -304,7 +312,7 @@ var ajax = function ajax(_ref) {
304
312
  } else if (response.data.rCode === 61) {
305
313
  clearTimeout(initAuth);
306
314
  initAuth = setTimeout(function () {
307
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"])({
315
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
308
316
  title: '请进行二次鉴权',
309
317
  closeOnClickModal: false,
310
318
  closeOnPressEscape: false,
@@ -1753,7 +1761,7 @@ var getWeekday = function getWeekday(date) {
1753
1761
  * @param {String} [url] - url地址
1754
1762
  **/
1755
1763
 
1756
- var handlerUrl = function handlerUrl(url, before) {
1764
+ var handlerUrl = function handlerUrl(url, param, before) {
1757
1765
  var arry = url.split('?');
1758
1766
  if (arry.length > 2) {
1759
1767
  var ary = arry.splice(1, arry.length);
@@ -1775,6 +1783,10 @@ var handlerUrl = function handlerUrl(url, before) {
1775
1783
  } else {
1776
1784
  url += '?_tt=' + new Date().getTime();
1777
1785
  }
1786
+ if (param) {
1787
+ var str = queryParams(param);
1788
+ url += '&' + str;
1789
+ }
1778
1790
  if (before && before === arry[0]) {
1779
1791
  var pathname = win.location.pathname;
1780
1792
  if (pathname === '/') {
@@ -1939,29 +1951,29 @@ var isLogined = function isLogined(_ref8) {
1939
1951
  loginPage = _ref8.loginPage,
1940
1952
  redirect = _ref8.redirect;
1941
1953
 
1942
- var logined = getStorage('logined');
1943
1954
  if (cookie === undefined) {
1944
1955
  cookie = getParams({ name: 'cookie' });
1945
1956
  }
1946
- // eslint-disable-next-line eqeqeq
1947
- if (logined || cookie == true || cookie == 1) {
1948
- if (loginPage) {
1949
- sessionStorage.setItem('loginPage', loginPage);
1950
- if (!startWith(loginPage, ['http', '/'], true)) {
1951
- var pathname = win.top.location.pathname;
1952
- if (pathname !== '/') {
1953
- pathname = pathname.split('/');
1954
- pathname.splice(pathname.length - 1);
1955
- pathname = pathname.join('/');
1956
- loginPage = pathname + '/' + loginPage.replace('./', '');
1957
- } else {
1958
- loginPage = pathname + loginPage.replace('./', '');
1959
- }
1957
+ if (loginPage) {
1958
+ sessionStorage.setItem('loginPage', loginPage);
1959
+ if (!startWith(loginPage, ['http', '/'], true)) {
1960
+ var pathname = win.top.location.pathname;
1961
+ if (pathname !== '/') {
1962
+ pathname = pathname.split('/');
1963
+ pathname.splice(pathname.length - 1);
1964
+ pathname = pathname.join('/');
1965
+ loginPage = pathname + '/' + loginPage.replace('./', '');
1966
+ } else {
1967
+ loginPage = pathname + loginPage.replace('./', '');
1960
1968
  }
1961
1969
  }
1962
- next();
1970
+ }
1971
+ var token = getStorage('token') || getStorage('Authorization');
1972
+ var logined = getStorage('logined');
1973
+ // eslint-disable-next-line eqeqeq
1974
+ if (token || logined || cookie == true || cookie == 1) {
1975
+ next && next();
1963
1976
  } else {
1964
- var token = getStorage('token') || getStorage('Authorization');
1965
1977
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1966
1978
  ajax({
1967
1979
  method: 'post',
@@ -2016,7 +2028,7 @@ var isLogined = function isLogined(_ref8) {
2016
2028
  }
2017
2029
  break;
2018
2030
  case 4:
2019
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2031
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2020
2032
  confirmButtonText: '确定',
2021
2033
  type: 'error',
2022
2034
  callback: function callback() {
@@ -2036,7 +2048,7 @@ var isLogined = function isLogined(_ref8) {
2036
2048
  default:
2037
2049
  }
2038
2050
  } else {
2039
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(res.msg, '提示', {
2051
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2040
2052
  confirmButtonText: '确定',
2041
2053
  type: 'error',
2042
2054
  callback: function callback() {
@@ -2167,7 +2179,7 @@ var loadJs = function loadJs(_ref10) {
2167
2179
  **/
2168
2180
  var loading = function loading($loading, res) {
2169
2181
  if (!$loading) {
2170
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_4__["Loading"].service;
2182
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2171
2183
  }
2172
2184
  if (isObject(res)) {
2173
2185
  var config = extend({}, {
@@ -2526,6 +2538,70 @@ var setStorage = function setStorage(_ref14) {
2526
2538
  }
2527
2539
  };
2528
2540
 
2541
+ /**
2542
+ * socket
2543
+ * @desc:webSocket
2544
+ * @author huangbo
2545
+ * @date 2022年5月7日
2546
+ * @param {String} [url] - 连接地址
2547
+ * @param {String} [take] - 订阅地址
2548
+ * @param {String} [debug] - 调试
2549
+ * @param {String} [interval] - 重连间隔时间
2550
+ **/
2551
+ function socket(options) {
2552
+ var nextDate = 0;
2553
+ var connect = 1;
2554
+ return new Promise(function (resolve, reject) {
2555
+ var wshost = getStorage('wshost') || '';
2556
+ var option = {
2557
+ url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2558
+ take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2559
+ debug: true,
2560
+ interval: 20
2561
+ };
2562
+ var websocket = win.websocket || {};
2563
+ if (options && isObject(options)) {
2564
+ option = _extends({}, option, options);
2565
+ }
2566
+ var key = window.btoa(option.url);
2567
+ if (!websocket[key]) {
2568
+ websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2569
+ win.websocket = websocket;
2570
+ }
2571
+
2572
+ var client = websocket[key] ? websocket[key].client : null;
2573
+ if (!client) {
2574
+ client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2575
+ !option.debug && (client.debug = null);
2576
+ }
2577
+ client.connect({}, function () {
2578
+ client.subscribe(option.take, function (response) {
2579
+ var res = JSON.parse(response.body);
2580
+ resolve(res, function () {
2581
+ client.disconnect();
2582
+ win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2583
+ }, client, websocket[key]);
2584
+ });
2585
+ }, function (error) {
2586
+ var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2587
+ if (connect > 5 && diffSecond < option.interval) {
2588
+ client.disconnect();
2589
+ if (win.top.websocket) {
2590
+ if (Object.keys(win.top.websocket).length > 1) {
2591
+ delete win.top.websocket[key];
2592
+ } else {
2593
+ delete win.top.websocket;
2594
+ }
2595
+ }
2596
+ } else {
2597
+ win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2598
+ socket(options);
2599
+ }, 5000);
2600
+ }
2601
+ reject(error);
2602
+ });
2603
+ });
2604
+ }
2529
2605
  /**
2530
2606
  * sum
2531
2607
  * @desc 求和
@@ -2778,7 +2854,6 @@ var urlJoinParams = function urlJoinParams(_ref15) {
2778
2854
  params[items[0]] = items[1];
2779
2855
  });
2780
2856
  }
2781
- '&_tt=' + new Date().getTime();
2782
2857
  params = extend(true, params, param);
2783
2858
  var str = queryParams(params);
2784
2859
  if (str) {
@@ -2946,6 +3021,7 @@ var watermark = function watermark(option) {
2946
3021
  sendMessage: sendMessage,
2947
3022
  setFavicon: setFavicon,
2948
3023
  setStorage: setStorage,
3024
+ socket: socket,
2949
3025
  startWith: startWith,
2950
3026
  sum: sum,
2951
3027
  takeLeft: takeLeft,
@@ -3305,6 +3381,13 @@ var formContents = '/config/admin/online/onlineForm/render';
3305
3381
 
3306
3382
  /***/ }),
3307
3383
 
3384
+ /***/ 11:
3385
+ /***/ (function(module, exports) {
3386
+
3387
+ module.exports = require("babel-runtime/regenerator");
3388
+
3389
+ /***/ }),
3390
+
3308
3391
  /***/ 2:
3309
3392
  /***/ (function(module, exports) {
3310
3393
 
@@ -3547,7 +3630,7 @@ render._withStripped = true
3547
3630
  // CONCATENATED MODULE: ./packages/sizer/src/main.vue?vue&type=template&id=14ef78da&
3548
3631
 
3549
3632
  // EXTERNAL MODULE: external "babel-runtime/regenerator"
3550
- var regenerator_ = __webpack_require__(9);
3633
+ var regenerator_ = __webpack_require__(11);
3551
3634
  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_);
3552
3635
 
3553
3636
  // EXTERNAL MODULE: ./src/config/api.js
@@ -3891,14 +3974,21 @@ module.exports = require("json-bigint");
3891
3974
  /***/ 7:
3892
3975
  /***/ (function(module, exports) {
3893
3976
 
3894
- module.exports = require("sm-crypto");
3977
+ module.exports = require("sockjs-client");
3978
+
3979
+ /***/ }),
3980
+
3981
+ /***/ 8:
3982
+ /***/ (function(module, exports) {
3983
+
3984
+ module.exports = require("stompjs");
3895
3985
 
3896
3986
  /***/ }),
3897
3987
 
3898
3988
  /***/ 9:
3899
3989
  /***/ (function(module, exports) {
3900
3990
 
3901
- module.exports = require("babel-runtime/regenerator");
3991
+ module.exports = require("sm-crypto");
3902
3992
 
3903
3993
  /***/ })
3904
3994
 
package/lib/steps.js CHANGED
@@ -98,8 +98,14 @@ module.exports =
98
98
  /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_2__);
99
99
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
100
100
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(json_bigint__WEBPACK_IMPORTED_MODULE_3__);
101
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
102
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_4__);
101
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
102
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_4__);
103
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
104
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_5__);
105
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
106
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_6__);
107
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
108
+
103
109
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
104
110
 
105
111
  /**
@@ -110,7 +116,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
110
116
  **/
111
117
 
112
118
  /* eslint-disable indent */
113
- var sm2 = __webpack_require__(7).sm2;
119
+ var sm2 = __webpack_require__(9).sm2;
120
+
121
+
114
122
 
115
123
 
116
124
 
@@ -257,7 +265,7 @@ var ajax = function ajax(_ref) {
257
265
  clearTimeout(loginMsg);
258
266
  loginMsg = setTimeout(function () {
259
267
  sessionStorage.setItem('remind', 1);
260
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
268
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
261
269
  confirmButtonText: '确定',
262
270
  closeOnClickModal: false,
263
271
  type: 'warning'
@@ -304,7 +312,7 @@ var ajax = function ajax(_ref) {
304
312
  } else if (response.data.rCode === 61) {
305
313
  clearTimeout(initAuth);
306
314
  initAuth = setTimeout(function () {
307
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"])({
315
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
308
316
  title: '请进行二次鉴权',
309
317
  closeOnClickModal: false,
310
318
  closeOnPressEscape: false,
@@ -1753,7 +1761,7 @@ var getWeekday = function getWeekday(date) {
1753
1761
  * @param {String} [url] - url地址
1754
1762
  **/
1755
1763
 
1756
- var handlerUrl = function handlerUrl(url, before) {
1764
+ var handlerUrl = function handlerUrl(url, param, before) {
1757
1765
  var arry = url.split('?');
1758
1766
  if (arry.length > 2) {
1759
1767
  var ary = arry.splice(1, arry.length);
@@ -1775,6 +1783,10 @@ var handlerUrl = function handlerUrl(url, before) {
1775
1783
  } else {
1776
1784
  url += '?_tt=' + new Date().getTime();
1777
1785
  }
1786
+ if (param) {
1787
+ var str = queryParams(param);
1788
+ url += '&' + str;
1789
+ }
1778
1790
  if (before && before === arry[0]) {
1779
1791
  var pathname = win.location.pathname;
1780
1792
  if (pathname === '/') {
@@ -1939,29 +1951,29 @@ var isLogined = function isLogined(_ref8) {
1939
1951
  loginPage = _ref8.loginPage,
1940
1952
  redirect = _ref8.redirect;
1941
1953
 
1942
- var logined = getStorage('logined');
1943
1954
  if (cookie === undefined) {
1944
1955
  cookie = getParams({ name: 'cookie' });
1945
1956
  }
1946
- // eslint-disable-next-line eqeqeq
1947
- if (logined || cookie == true || cookie == 1) {
1948
- if (loginPage) {
1949
- sessionStorage.setItem('loginPage', loginPage);
1950
- if (!startWith(loginPage, ['http', '/'], true)) {
1951
- var pathname = win.top.location.pathname;
1952
- if (pathname !== '/') {
1953
- pathname = pathname.split('/');
1954
- pathname.splice(pathname.length - 1);
1955
- pathname = pathname.join('/');
1956
- loginPage = pathname + '/' + loginPage.replace('./', '');
1957
- } else {
1958
- loginPage = pathname + loginPage.replace('./', '');
1959
- }
1957
+ if (loginPage) {
1958
+ sessionStorage.setItem('loginPage', loginPage);
1959
+ if (!startWith(loginPage, ['http', '/'], true)) {
1960
+ var pathname = win.top.location.pathname;
1961
+ if (pathname !== '/') {
1962
+ pathname = pathname.split('/');
1963
+ pathname.splice(pathname.length - 1);
1964
+ pathname = pathname.join('/');
1965
+ loginPage = pathname + '/' + loginPage.replace('./', '');
1966
+ } else {
1967
+ loginPage = pathname + loginPage.replace('./', '');
1960
1968
  }
1961
1969
  }
1962
- next();
1970
+ }
1971
+ var token = getStorage('token') || getStorage('Authorization');
1972
+ var logined = getStorage('logined');
1973
+ // eslint-disable-next-line eqeqeq
1974
+ if (token || logined || cookie == true || cookie == 1) {
1975
+ next && next();
1963
1976
  } else {
1964
- var token = getStorage('token') || getStorage('Authorization');
1965
1977
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1966
1978
  ajax({
1967
1979
  method: 'post',
@@ -2016,7 +2028,7 @@ var isLogined = function isLogined(_ref8) {
2016
2028
  }
2017
2029
  break;
2018
2030
  case 4:
2019
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2031
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2020
2032
  confirmButtonText: '确定',
2021
2033
  type: 'error',
2022
2034
  callback: function callback() {
@@ -2036,7 +2048,7 @@ var isLogined = function isLogined(_ref8) {
2036
2048
  default:
2037
2049
  }
2038
2050
  } else {
2039
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(res.msg, '提示', {
2051
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2040
2052
  confirmButtonText: '确定',
2041
2053
  type: 'error',
2042
2054
  callback: function callback() {
@@ -2167,7 +2179,7 @@ var loadJs = function loadJs(_ref10) {
2167
2179
  **/
2168
2180
  var loading = function loading($loading, res) {
2169
2181
  if (!$loading) {
2170
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_4__["Loading"].service;
2182
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2171
2183
  }
2172
2184
  if (isObject(res)) {
2173
2185
  var config = extend({}, {
@@ -2526,6 +2538,70 @@ var setStorage = function setStorage(_ref14) {
2526
2538
  }
2527
2539
  };
2528
2540
 
2541
+ /**
2542
+ * socket
2543
+ * @desc:webSocket
2544
+ * @author huangbo
2545
+ * @date 2022年5月7日
2546
+ * @param {String} [url] - 连接地址
2547
+ * @param {String} [take] - 订阅地址
2548
+ * @param {String} [debug] - 调试
2549
+ * @param {String} [interval] - 重连间隔时间
2550
+ **/
2551
+ function socket(options) {
2552
+ var nextDate = 0;
2553
+ var connect = 1;
2554
+ return new Promise(function (resolve, reject) {
2555
+ var wshost = getStorage('wshost') || '';
2556
+ var option = {
2557
+ url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2558
+ take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2559
+ debug: true,
2560
+ interval: 20
2561
+ };
2562
+ var websocket = win.websocket || {};
2563
+ if (options && isObject(options)) {
2564
+ option = _extends({}, option, options);
2565
+ }
2566
+ var key = window.btoa(option.url);
2567
+ if (!websocket[key]) {
2568
+ websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2569
+ win.websocket = websocket;
2570
+ }
2571
+
2572
+ var client = websocket[key] ? websocket[key].client : null;
2573
+ if (!client) {
2574
+ client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2575
+ !option.debug && (client.debug = null);
2576
+ }
2577
+ client.connect({}, function () {
2578
+ client.subscribe(option.take, function (response) {
2579
+ var res = JSON.parse(response.body);
2580
+ resolve(res, function () {
2581
+ client.disconnect();
2582
+ win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2583
+ }, client, websocket[key]);
2584
+ });
2585
+ }, function (error) {
2586
+ var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2587
+ if (connect > 5 && diffSecond < option.interval) {
2588
+ client.disconnect();
2589
+ if (win.top.websocket) {
2590
+ if (Object.keys(win.top.websocket).length > 1) {
2591
+ delete win.top.websocket[key];
2592
+ } else {
2593
+ delete win.top.websocket;
2594
+ }
2595
+ }
2596
+ } else {
2597
+ win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2598
+ socket(options);
2599
+ }, 5000);
2600
+ }
2601
+ reject(error);
2602
+ });
2603
+ });
2604
+ }
2529
2605
  /**
2530
2606
  * sum
2531
2607
  * @desc 求和
@@ -2778,7 +2854,6 @@ var urlJoinParams = function urlJoinParams(_ref15) {
2778
2854
  params[items[0]] = items[1];
2779
2855
  });
2780
2856
  }
2781
- '&_tt=' + new Date().getTime();
2782
2857
  params = extend(true, params, param);
2783
2858
  var str = queryParams(params);
2784
2859
  if (str) {
@@ -2946,6 +3021,7 @@ var watermark = function watermark(option) {
2946
3021
  sendMessage: sendMessage,
2947
3022
  setFavicon: setFavicon,
2948
3023
  setStorage: setStorage,
3024
+ socket: socket,
2949
3025
  startWith: startWith,
2950
3026
  sum: sum,
2951
3027
  takeLeft: takeLeft,
@@ -3774,6 +3850,20 @@ module.exports = require("json-bigint");
3774
3850
  /***/ 7:
3775
3851
  /***/ (function(module, exports) {
3776
3852
 
3853
+ module.exports = require("sockjs-client");
3854
+
3855
+ /***/ }),
3856
+
3857
+ /***/ 8:
3858
+ /***/ (function(module, exports) {
3859
+
3860
+ module.exports = require("stompjs");
3861
+
3862
+ /***/ }),
3863
+
3864
+ /***/ 9:
3865
+ /***/ (function(module, exports) {
3866
+
3777
3867
  module.exports = require("sm-crypto");
3778
3868
 
3779
3869
  /***/ })