ecinc-cloud-wappaio 9.6.238 → 9.6.239

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.
@@ -10167,8 +10167,6 @@ var actions = {
10167
10167
  generateRoutes: function generateRoutes(_ref, nowf) {
10168
10168
  var commit = _ref.commit;
10169
10169
  return new Promise(function (resolve, reject) {
10170
- // 登录成功后连接webSocket
10171
- _websocket_index__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.connectWebSocket(window.$wapp);
10172
10170
  window.$user.findNavMenus(nowf).then(function (response) {
10173
10171
  var layout = window.$loadComponent('@/wapp/common/layout/index');
10174
10172
  var accessedRoutes = [];
@@ -10194,6 +10192,12 @@ var actions = {
10194
10192
  }
10195
10193
  }
10196
10194
  commit('SET_ROUTES', accessedRoutes);
10195
+
10196
+ // 登录成功后连接webSocket
10197
+ var href = location.href.split('#')[1];
10198
+ if (href.indexOf('/lm/') !== -1 || href.indexOf('/portal') !== -1 || href.indexOf('/0/') !== -1) {
10199
+ _websocket_index__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.connectWebSocket(window.$wapp);
10200
+ }
10197
10201
  resolve(accessedRoutes);
10198
10202
  }).catch(function (error) {
10199
10203
  reject(error);
@@ -10731,7 +10735,7 @@ function connectWebSocket(scope) {
10731
10735
  var loginUser = scope.$store.getters.loginUser;
10732
10736
  var protocols = []; // 可选的子协议数组
10733
10737
  var options = {
10734
- debug: false,
10738
+ debug: true,
10735
10739
  // 自动重新连接的选项(可选)
10736
10740
  reconnectInterval: 3000,
10737
10741
  //重新连接尝试之间的间隔时间(毫秒)
@@ -10750,9 +10754,9 @@ function connectWebSocket(scope) {
10750
10754
  wsSocket = new WebSocket(wsurl + loginUser.userId + '_' + (window.deviceId || 'web'), protocols, options);
10751
10755
 
10752
10756
  // 连接发生错误的回调方法
10753
- wsSocket.onerror = function (event) {
10757
+ wsSocket.onerror = function (event, b) {
10754
10758
  connect = false;
10755
- console.log('websocket连接错误===', event);
10759
+ console.log('websocket连接错误===', event, b);
10756
10760
  //通知业务
10757
10761
  scope.$bus.emit('webSocketError', event);
10758
10762
  };
@@ -143381,7 +143385,10 @@ service.interceptors.response.use(function (response) {
143381
143385
  }
143382
143386
  return response.data;
143383
143387
  }, function (error) {
143384
- if (error.response && error.response.status === 401 && location.href.toLowerCase().indexOf('login') === -1 && error.config.url.indexOf('http:') === -1 && error.config.url.indexOf('https:') === -1) {
143388
+ var $scope = window.$wapp || window.$mapp;
143389
+ if ($scope && $scope.customErrorHander) {
143390
+ $scope.customErrorHander(error);
143391
+ } else if (error.response && error.response.status === 401 && location.href.toLowerCase().indexOf('login') === -1 && error.config.url.indexOf('http:') === -1 && error.config.url.indexOf('https:') === -1) {
143385
143392
  store/* default */.A.dispatch('user/resetToken').then(function () {
143386
143393
  if (window.vType === 'wapp') {
143387
143394
  //认证会话已过期,请重新登录。
@@ -10177,8 +10177,6 @@ var actions = {
10177
10177
  generateRoutes: function generateRoutes(_ref, nowf) {
10178
10178
  var commit = _ref.commit;
10179
10179
  return new Promise(function (resolve, reject) {
10180
- // 登录成功后连接webSocket
10181
- _websocket_index__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.connectWebSocket(window.$wapp);
10182
10180
  window.$user.findNavMenus(nowf).then(function (response) {
10183
10181
  var layout = window.$loadComponent('@/wapp/common/layout/index');
10184
10182
  var accessedRoutes = [];
@@ -10204,6 +10202,12 @@ var actions = {
10204
10202
  }
10205
10203
  }
10206
10204
  commit('SET_ROUTES', accessedRoutes);
10205
+
10206
+ // 登录成功后连接webSocket
10207
+ var href = location.href.split('#')[1];
10208
+ if (href.indexOf('/lm/') !== -1 || href.indexOf('/portal') !== -1 || href.indexOf('/0/') !== -1) {
10209
+ _websocket_index__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.connectWebSocket(window.$wapp);
10210
+ }
10207
10211
  resolve(accessedRoutes);
10208
10212
  }).catch(function (error) {
10209
10213
  reject(error);
@@ -10741,7 +10745,7 @@ function connectWebSocket(scope) {
10741
10745
  var loginUser = scope.$store.getters.loginUser;
10742
10746
  var protocols = []; // 可选的子协议数组
10743
10747
  var options = {
10744
- debug: false,
10748
+ debug: true,
10745
10749
  // 自动重新连接的选项(可选)
10746
10750
  reconnectInterval: 3000,
10747
10751
  //重新连接尝试之间的间隔时间(毫秒)
@@ -10760,9 +10764,9 @@ function connectWebSocket(scope) {
10760
10764
  wsSocket = new WebSocket(wsurl + loginUser.userId + '_' + (window.deviceId || 'web'), protocols, options);
10761
10765
 
10762
10766
  // 连接发生错误的回调方法
10763
- wsSocket.onerror = function (event) {
10767
+ wsSocket.onerror = function (event, b) {
10764
10768
  connect = false;
10765
- console.log('websocket连接错误===', event);
10769
+ console.log('websocket连接错误===', event, b);
10766
10770
  //通知业务
10767
10771
  scope.$bus.emit('webSocketError', event);
10768
10772
  };
@@ -143391,7 +143395,10 @@ service.interceptors.response.use(function (response) {
143391
143395
  }
143392
143396
  return response.data;
143393
143397
  }, function (error) {
143394
- if (error.response && error.response.status === 401 && location.href.toLowerCase().indexOf('login') === -1 && error.config.url.indexOf('http:') === -1 && error.config.url.indexOf('https:') === -1) {
143398
+ var $scope = window.$wapp || window.$mapp;
143399
+ if ($scope && $scope.customErrorHander) {
143400
+ $scope.customErrorHander(error);
143401
+ } else if (error.response && error.response.status === 401 && location.href.toLowerCase().indexOf('login') === -1 && error.config.url.indexOf('http:') === -1 && error.config.url.indexOf('https:') === -1) {
143395
143402
  store/* default */.A.dispatch('user/resetToken').then(function () {
143396
143403
  if (window.vType === 'wapp') {
143397
143404
  //认证会话已过期,请重新登录。