eoss-ui 0.5.10 → 0.5.12

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 (77) hide show
  1. package/lib/button-group.js +246 -157
  2. package/lib/button.js +185 -108
  3. package/lib/card.js +2 -2
  4. package/lib/cascader.js +2 -2
  5. package/lib/checkbox-group.js +184 -108
  6. package/lib/clients.js +2 -2
  7. package/lib/data-table-form.js +183 -107
  8. package/lib/data-table.js +216 -131
  9. package/lib/date-picker.js +190 -113
  10. package/lib/dialog.js +192 -116
  11. package/lib/enterprise.js +2 -2
  12. package/lib/eoss-ui.common.js +506 -642
  13. package/lib/error-page.js +2 -2
  14. package/lib/flow-group.js +183 -106
  15. package/lib/flow-list.js +218 -116
  16. package/lib/flow.js +218 -125
  17. package/lib/form.js +308 -323
  18. package/lib/handle-user.js +186 -109
  19. package/lib/handler.js +184 -107
  20. package/lib/icons.js +4 -4
  21. package/lib/index.js +1 -1
  22. package/lib/input-number.js +185 -108
  23. package/lib/input.js +187 -110
  24. package/lib/label.js +2 -2
  25. package/lib/layout.js +4 -4
  26. package/lib/login.js +186 -110
  27. package/lib/main.js +311 -385
  28. package/lib/menu.js +2 -2
  29. package/lib/nav.js +185 -108
  30. package/lib/notify.js +2 -2
  31. package/lib/page.js +185 -108
  32. package/lib/pagination.js +2 -2
  33. package/lib/player.js +191 -114
  34. package/lib/qr-code.js +187 -110
  35. package/lib/radio-group.js +188 -111
  36. package/lib/retrial-auth.js +185 -108
  37. package/lib/select-ganged.js +183 -106
  38. package/lib/select.js +184 -107
  39. package/lib/selector-panel.js +184 -108
  40. package/lib/selector.js +185 -108
  41. package/lib/sizer.js +187 -110
  42. package/lib/steps.js +185 -108
  43. package/lib/switch.js +185 -108
  44. package/lib/table-form.js +197 -136
  45. package/lib/tabs-panel.js +2 -2
  46. package/lib/tabs.js +188 -111
  47. package/lib/theme-chalk/index.css +1 -1
  48. package/lib/theme-chalk/pagination.css +1 -1
  49. package/lib/theme-chalk/toolbar.css +1 -1
  50. package/lib/tips.js +185 -108
  51. package/lib/toolbar.js +21 -11
  52. package/lib/tree-group.js +183 -106
  53. package/lib/tree.js +183 -106
  54. package/lib/upload.js +186 -110
  55. package/lib/utils/util.js +35 -94
  56. package/lib/utils/webSocket.js +134 -0
  57. package/lib/wujie.js +185 -108
  58. package/lib/wxlogin.js +185 -108
  59. package/package.json +1 -1
  60. package/packages/data-table/src/main.vue +16 -8
  61. package/packages/data-table/src/sizer.vue +1 -1
  62. package/packages/flow/src/main.vue +2 -0
  63. package/packages/flow/src/processForm.vue +23 -9
  64. package/packages/flow-list/src/main.vue +25 -2
  65. package/packages/form/src/main.vue +11 -46
  66. package/packages/form/src/table.vue +6 -11
  67. package/packages/main/src/main.vue +25 -164
  68. package/packages/radio-group/src/main.vue +1 -5
  69. package/packages/theme-chalk/lib/index.css +1 -1
  70. package/packages/theme-chalk/lib/pagination.css +1 -1
  71. package/packages/theme-chalk/lib/toolbar.css +1 -1
  72. package/packages/theme-chalk/src/pagination.scss +8 -0
  73. package/packages/theme-chalk/src/toolbar.scss +1 -0
  74. package/packages/toolbar/src/main.vue +17 -8
  75. package/src/index.js +1 -1
  76. package/src/utils/util.js +58 -115
  77. package/src/utils/webSocket.js +103 -0
package/lib/player.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 52);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 53);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -98,14 +98,9 @@ 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 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
-
101
+ /* harmony import */ var _webSocket__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
102
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2);
103
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_5__);
109
104
  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; };
110
105
 
111
106
  /**
@@ -116,8 +111,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
116
111
  **/
117
112
 
118
113
  /* eslint-disable indent */
119
- var sm2 = __webpack_require__(9).sm2;
120
-
114
+ var sm2 = __webpack_require__(10).sm2;
121
115
 
122
116
 
123
117
 
@@ -265,7 +259,7 @@ var ajax = function ajax(_ref) {
265
259
  clearTimeout(loginMsg);
266
260
  loginMsg = setTimeout(function () {
267
261
  sessionStorage.setItem('remind', 1);
268
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
262
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
269
263
  confirmButtonText: '确定',
270
264
  closeOnClickModal: false,
271
265
  type: 'warning'
@@ -312,7 +306,7 @@ var ajax = function ajax(_ref) {
312
306
  } else if (response.data.rCode === 61) {
313
307
  clearTimeout(initAuth);
314
308
  initAuth = setTimeout(function () {
315
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
309
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"])({
316
310
  title: '请进行二次鉴权',
317
311
  closeOnClickModal: false,
318
312
  closeOnPressEscape: false,
@@ -746,6 +740,7 @@ var delUrlParam = function delUrlParam(_ref2) {
746
740
  key.forEach(function (item) {
747
741
  if (param.hasOwnProperty(item)) {
748
742
  var reg = item + '=' + param[item];
743
+ console.log(reg);
749
744
  if (src.indexOf(reg + '&') > -1) {
750
745
  src = src.replace(reg + '&', '');
751
746
  } else if (src.indexOf('&' + reg) > -1) {
@@ -1946,7 +1941,6 @@ var isLogined = function isLogined(_ref8) {
1946
1941
  next = _ref8.next,
1947
1942
  _ref8$exclude = _ref8.exclude,
1948
1943
  exclude = _ref8$exclude === undefined ? [] : _ref8$exclude,
1949
- open = _ref8.open,
1950
1944
  cookie = _ref8.cookie,
1951
1945
  loginPage = _ref8.loginPage,
1952
1946
  redirect = _ref8.redirect;
@@ -1954,24 +1948,24 @@ var isLogined = function isLogined(_ref8) {
1954
1948
  if (cookie === undefined) {
1955
1949
  cookie = getParams({ name: 'cookie' });
1956
1950
  }
1951
+ var pathname = win.top.location.pathname;
1957
1952
  if (loginPage) {
1958
1953
  sessionStorage.setItem('loginPage', loginPage);
1959
1954
  if (!startWith(loginPage, ['http', '/'], true)) {
1960
- var pathname = win.top.location.pathname;
1961
1955
  if (pathname !== '/') {
1962
- pathname = pathname.split('/');
1963
- pathname.splice(pathname.length - 1);
1964
- pathname = pathname.join('/');
1965
- loginPage = pathname + '/' + loginPage.replace('./', '');
1956
+ var path = pathname.split('/');
1957
+ path.splice(pathname.length - 1);
1958
+ path = path.join('/');
1959
+ loginPage = path + '/' + loginPage.replace('./', '');
1966
1960
  } else {
1967
1961
  loginPage = pathname + loginPage.replace('./', '');
1968
1962
  }
1969
1963
  }
1970
1964
  }
1971
1965
  var token = getStorage('token') || getStorage('Authorization');
1972
- var logined = getStorage('logined');
1966
+ // const logined = getStorage('logined');
1973
1967
  // eslint-disable-next-line eqeqeq
1974
- if (token || logined || cookie == true || cookie == 1) {
1968
+ if (token || cookie == true || cookie == 1) {
1975
1969
  next && next();
1976
1970
  } else {
1977
1971
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
@@ -1995,40 +1989,25 @@ var isLogined = function isLogined(_ref8) {
1995
1989
  deviceUnique: results.deviceUnique
1996
1990
  }
1997
1991
  });
1998
- next();
1992
+ var url = delUrlParam({
1993
+ url: win.top.location.href,
1994
+ key: ['serverId', 'authType', 'code', 'sessionId']
1995
+ });
1996
+ win.top.location.href = url;
1997
+ setTimeout(function () {
1998
+ win.top.location.reload();
1999
+ }, 200);
1999
2000
  break;
2000
2001
  case 1:
2001
2002
  break;
2002
2003
  case 2:
2003
2004
  break;
2004
2005
  case 3:
2005
- var url = win.top.location.href;
2006
- var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(url));
2007
- if (to.query.openType) {
2008
- switch (to.query.openType) {
2009
- case 'self':
2010
- win.location.href = href;
2011
- break;
2012
- case 'blank':
2013
- win.open(href);
2014
- break;
2015
- case 'top':
2016
- win.top.location.href = href;
2017
- break;
2018
- case 'parent':
2019
- win.parent.location.href = href;
2020
- break;
2021
- }
2022
- } else {
2023
- if (open) {
2024
- win.open(href);
2025
- } else {
2026
- win.top.location.href = href;
2027
- }
2028
- }
2006
+ var href = results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(win.top.location.href));
2007
+ win.top.location.href = href;
2029
2008
  break;
2030
2009
  case 4:
2031
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2010
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2032
2011
  confirmButtonText: '确定',
2033
2012
  type: 'error',
2034
2013
  callback: function callback() {
@@ -2048,7 +2027,7 @@ var isLogined = function isLogined(_ref8) {
2048
2027
  default:
2049
2028
  }
2050
2029
  } else {
2051
- eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2030
+ eoss_element__WEBPACK_IMPORTED_MODULE_5__["MessageBox"].alert(res.msg, '提示', {
2052
2031
  confirmButtonText: '确定',
2053
2032
  type: 'error',
2054
2033
  callback: function callback() {
@@ -2179,7 +2158,7 @@ var loadJs = function loadJs(_ref10) {
2179
2158
  **/
2180
2159
  var loading = function loading($loading, res) {
2181
2160
  if (!$loading) {
2182
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2161
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_5__["Loading"].service;
2183
2162
  }
2184
2163
  if (isObject(res)) {
2185
2164
  var config = extend({}, {
@@ -2544,63 +2523,25 @@ var setStorage = function setStorage(_ref14) {
2544
2523
  * @author huangbo
2545
2524
  * @date 2022年5月7日
2546
2525
  * @param {String} [url] - 连接地址
2526
+ * @param {String} [send] - 是否发送消息
2547
2527
  * @param {String} [take] - 订阅地址
2548
2528
  * @param {String} [debug] - 调试
2549
2529
  * @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
- });
2530
+ * @param {Function} [success] - 调试
2531
+ * @param {Function} [error] - 重连间隔时间
2532
+ **/
2533
+ function socket(option, vm) {
2534
+ var options = {};
2535
+ for (var i in option) {
2536
+ if (i === 'send') {
2537
+ options['isSend'] = option[i];
2538
+ } else {
2539
+ options[i] = option[i];
2540
+ }
2541
+ }
2542
+ var socket = new _webSocket__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"]();
2543
+ socket.init(options, vm);
2544
+ return socket;
2604
2545
  }
2605
2546
  /**
2606
2547
  * sum
@@ -3381,7 +3322,14 @@ var formContents = '/config/admin/online/onlineForm/render';
3381
3322
 
3382
3323
  /***/ }),
3383
3324
 
3384
- /***/ 17:
3325
+ /***/ 10:
3326
+ /***/ (function(module, exports) {
3327
+
3328
+ module.exports = require("sm-crypto");
3329
+
3330
+ /***/ }),
3331
+
3332
+ /***/ 18:
3385
3333
  /***/ (function(module, exports) {
3386
3334
 
3387
3335
  module.exports = require("video.js");
@@ -3395,14 +3343,14 @@ module.exports = require("eoss-element");
3395
3343
 
3396
3344
  /***/ }),
3397
3345
 
3398
- /***/ 21:
3346
+ /***/ 22:
3399
3347
  /***/ (function(module, exports) {
3400
3348
 
3401
3349
  module.exports = require("video.js/dist/lang/zh-CN.json");
3402
3350
 
3403
3351
  /***/ }),
3404
3352
 
3405
- /***/ 25:
3353
+ /***/ 26:
3406
3354
  /***/ (function(module, exports) {
3407
3355
 
3408
3356
  module.exports = require("video.js/dist/video-js.css");
@@ -3528,7 +3476,7 @@ module.exports = require("axios");
3528
3476
 
3529
3477
  /***/ }),
3530
3478
 
3531
- /***/ 52:
3479
+ /***/ 53:
3532
3480
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3533
3481
 
3534
3482
  "use strict";
@@ -3556,15 +3504,15 @@ render._withStripped = true
3556
3504
  // CONCATENATED MODULE: ./packages/player/src/main.vue?vue&type=template&id=29c1659e&
3557
3505
 
3558
3506
  // EXTERNAL MODULE: external "video.js"
3559
- var external_video_js_ = __webpack_require__(17);
3507
+ var external_video_js_ = __webpack_require__(18);
3560
3508
  var external_video_js_default = /*#__PURE__*/__webpack_require__.n(external_video_js_);
3561
3509
 
3562
3510
  // EXTERNAL MODULE: external "video.js/dist/lang/zh-CN.json"
3563
- var zh_CN_json_ = __webpack_require__(21);
3511
+ var zh_CN_json_ = __webpack_require__(22);
3564
3512
  var zh_CN_json_default = /*#__PURE__*/__webpack_require__.n(zh_CN_json_);
3565
3513
 
3566
3514
  // EXTERNAL MODULE: external "video.js/dist/video-js.css"
3567
- var video_js_css_ = __webpack_require__(25);
3515
+ var video_js_css_ = __webpack_require__(26);
3568
3516
 
3569
3517
  // EXTERNAL MODULE: ./src/utils/util.js
3570
3518
  var util = __webpack_require__(0);
@@ -3809,23 +3757,152 @@ module.exports = require("json-bigint");
3809
3757
  /***/ }),
3810
3758
 
3811
3759
  /***/ 7:
3812
- /***/ (function(module, exports) {
3760
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3813
3761
 
3814
- module.exports = require("sockjs-client");
3762
+ "use strict";
3763
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
3764
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
3765
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
3766
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
3767
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3768
+
3769
+
3770
+
3771
+
3772
+ var WebSocket = function () {
3773
+ // 构造函数
3774
+ function WebSocket() {
3775
+ _classCallCheck(this, WebSocket);
3776
+
3777
+ this.host = sessionStorage.getItem('wshost') || '';
3778
+ this.tryTimes = 1; // 重连次数
3779
+ this.callback = null; // 回调函数
3780
+ this.client = null; // stomp对象
3781
+ this.reconTimeout = null; // 重连延时器
3782
+ this.debug = true; // 调试
3783
+ this.interval = 20; // 重连间隔时间
3784
+ this.vm = null;
3785
+ this.nextDate = 0;
3786
+ this.connects = 1;
3787
+ this.recon = false;
3788
+ this.sendTimeout = null;
3789
+ this.isSend = false;
3790
+ }
3791
+
3792
+ /** socket连接 */
3793
+
3794
+
3795
+ WebSocket.prototype.connect = function connect() {
3796
+ var _this = this;
3797
+
3798
+ if (!this.client) {
3799
+ // 连接SockJS
3800
+ var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3801
+ // 获取STOMP子协议的客户端对象
3802
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3803
+ }
3804
+
3805
+ // 日志不打印
3806
+ if (!this.debug) {
3807
+ console.log(111);
3808
+ this.client.debug = function () {};
3809
+ }
3810
+
3811
+ // 向服务器发起websocket连接
3812
+ this.client.connect({}, function () {
3813
+ _this.recon = true;
3814
+ // tryTimes定义重置
3815
+ _this.connects = 1;
3816
+ // 订阅消息
3817
+ // if (!this.isSend) {
3818
+ _this.subscribe();
3819
+ // }
3820
+ }, function (error) {
3821
+ var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3822
+ if (_this.connects > 5 && diffSecond < _this.interval) {
3823
+ _this.client.disconnect();
3824
+ _this.error && _this.error(error);
3825
+ } else {
3826
+ _this.reconTimeout = setTimeout(function () {
3827
+ _this.connect();
3828
+ _this.connects++;
3829
+ }, 5000);
3830
+ }
3831
+ });
3832
+ };
3833
+ /** 订阅服务端 */
3834
+
3835
+
3836
+ WebSocket.prototype.subscribe = function subscribe() {
3837
+ var _this2 = this;
3838
+
3839
+ // 订阅服务端提供的某个topic
3840
+ this.client.subscribe(this.take, function (response) {
3841
+ if (response && (_this2.callback || _this2.success)) {
3842
+ var callback = _this2.callback || _this2.success;
3843
+ callback(JSON.parse(response.body));
3844
+ }
3845
+ });
3846
+ };
3847
+
3848
+ /** 赋值、初始化socket */
3849
+
3850
+
3851
+ WebSocket.prototype.init = function init(option, vm) {
3852
+ for (var i in option) {
3853
+ this[i] = option[i];
3854
+ }
3855
+ this.vm = vm;
3856
+ // 初始化连接
3857
+ this.connect();
3858
+ };
3859
+
3860
+ /** 发送消息 */
3861
+
3862
+
3863
+ WebSocket.prototype.send = function send(data) {
3864
+ var _this3 = this;
3865
+
3866
+ if (this.recon) {
3867
+ clearTimeout(this.sendTimeout);
3868
+ this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
3869
+ } else {
3870
+ this.sendTimeout = setTimeout(function () {
3871
+ _this3.send(data);
3872
+ }, 1000);
3873
+ }
3874
+ };
3875
+
3876
+ /** 销毁 */
3877
+
3878
+
3879
+ WebSocket.prototype.destroy = function destroy() {
3880
+ // 断开连接,清除定时器
3881
+ if (this.client) {
3882
+ this.client.disconnect();
3883
+ };
3884
+ this.reconTimeout && clearTimeout(this.reconTimeout);
3885
+ this.sendTimeout && clearTimeout(this.sendTimeout);
3886
+ };
3887
+
3888
+ return WebSocket;
3889
+ }();
3890
+
3891
+ /* harmony default export */ __webpack_exports__["a"] = (WebSocket);
3815
3892
 
3816
3893
  /***/ }),
3817
3894
 
3818
3895
  /***/ 8:
3819
3896
  /***/ (function(module, exports) {
3820
3897
 
3821
- module.exports = require("stompjs");
3898
+ module.exports = require("sockjs-client");
3822
3899
 
3823
3900
  /***/ }),
3824
3901
 
3825
3902
  /***/ 9:
3826
3903
  /***/ (function(module, exports) {
3827
3904
 
3828
- module.exports = require("sm-crypto");
3905
+ module.exports = require("stompjs");
3829
3906
 
3830
3907
  /***/ })
3831
3908