system-clients 3.2.65-1 → 3.2.65-wuhai

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.
@@ -235,9 +235,6 @@ export default {
235
235
  }
236
236
  },
237
237
  ready() {
238
- //使用socket发送代办消息提醒
239
- vue.prototype.$connectNumber = this.connectNumber
240
- this.initWebSocket()
241
238
  getwartermakr(this);
242
239
  let component = this.$login.getUrlCompileParames('component')
243
240
  if (component) {
@@ -287,94 +284,6 @@ export default {
287
284
  this.functions.f_role_name && this.functions.f_role_name.includes(this.config.msgRole) && this.config.isTip && this.getOrderList()
288
285
  },
289
286
  methods: {
290
- // 清除
291
- reset () {
292
- clearTimeout(this.timeoutObj)
293
- clearTimeout(this.serverTimeoutObj)
294
- },
295
- //每隔几分钟发送一个固定信息给服务端,服务端收到后回复一个固定信息
296
- //如果服务端在一定时间内没有收到信息,就认为客户端断开了,服务端就会断开连接
297
- // 发送心跳--确保连接有效
298
- start () {
299
- // 重置
300
- vue.prototype.$connectNumber = this.connectNumber // 重置重连次数
301
- this.timeoutObj = setTimeout(() => {
302
- this.$socket.send('ping')
303
- console.log('ping!')
304
- this.serverTimeoutObj = setTimeout(() => {
305
- this.$socket.close()
306
- }, this.timeout)
307
- }, this.timeout)
308
- },
309
- // 重连
310
- reconnect () {
311
- if (this.lockReconnect) return
312
- // if (this.$connectNumber <= 0) {
313
- // vue.showMessage('连接已断开,将无法接收消息,请重新登录', ['confirm']).then((res) => {
314
- // if (res === 'confirm') {
315
- // location.reload()
316
- // }
317
- // })
318
- // return
319
- // }
320
- // this.$connectNumber--
321
- setTimeout(() => {
322
- console.log('连接异常,尝试重新连接。。。。')
323
- this.initWebSocket()
324
- this.lockReconnect = false
325
- }, 1000 * 60)
326
- },
327
- // 初始化
328
- initWebSocket () {
329
- let path = `ws://${location.host}/ws?token=${this.$login.f.id}`
330
- try {
331
- if ('WebSocket' in window) {
332
- // 创建对象
333
- vue.prototype.$socket = new WebSocket(path)
334
- } else {
335
- this.$showMessage('您的浏览器不支持websocket的协议,建议使用新版谷歌浏览器,请勿使用IE浏览器,360浏览器请使用极速模式,不要使用兼容模式!"')
336
- }
337
- } catch (e) {
338
- this.reconnect()
339
- }
340
-
341
- this.$socket.onopen = this.onOpen // 连接成功
342
- this.$socket.onmessage = this.onMessage // 收到消息时回调
343
- this.$socket.onclose = this.onClose // 连接关闭时回调
344
- this.$socket.onerror = this.onError // 通讯异常
345
- },
346
- // 通讯异常
347
- onError () {
348
- console.log('通讯异常')
349
- this.reconnect()
350
- },
351
- // 连接成功
352
- onOpen () {
353
- console.log('webSocket连接成功')
354
- this.start()//每十秒发送心跳包,确保连接状态有效
355
- },
356
- // 收到消息时回调函数
357
- onMessage (event) {
358
- if (event.data === 'pong') { //建立心跳机制发送ping,返回pong
359
- this.reset() // 重置心跳
360
- this.start() // 重新开始心跳
361
- return
362
- }
363
- //不是pong消息,就是服务器返回的消息(提示消息)
364
-
365
- let data = JSON.parse(event.data)
366
- console.log('收到消息', data)
367
- //向所有子组件广播一个名为'onMessage'的事件,并传递一个数据参数'data'。
368
- this.$broadcast('onMessage', data)
369
- //作用是显示一个消息。
370
- this.$showMessage(data.message)
371
- },
372
- // 关闭连接时回调函数
373
- onClose () {
374
- console.log('webSocket连接断开')
375
- this.reset()
376
- this.reconnect() // 重连
377
- },
378
287
  getOrderList(){
379
288
  let times = this.config.times * 60 * 1000
380
289
  console.log("=定时提示间隔=", times)
@@ -1,15 +1,15 @@
1
- import Vue from 'vue'
2
- import Validator from 'vue-validator'
3
- Vue.use(Validator)
4
- //密码强度验证器(必须为为大小写字母、阿拉伯数字、字符)
5
- Vue.validator('strongpassword', function (val) {
6
- return /^(?:(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])).*$/.test(val)
7
- });
8
- Vue.validator('chinesePassword', function (val) {
9
- var testBealoon=/.*?[\u4E00-\u9FFF]+.*$/.test(val)
10
- return !(/.*?[\u4E00-\u9FFF]+.*$/.test(val))
11
- });
12
- // 潜能要求8~16位数字字母组合;
13
- Vue.validator('numbersAndLetter8to16', function (val) {
14
- return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/.test(val)
15
- });
1
+ import Vue from 'vue'
2
+ import Validator from 'vue-validator'
3
+ Vue.use(Validator)
4
+ //密码强度验证器(必须为为大小写字母、阿拉伯数字、字符)
5
+ Vue.validator('strongpassword', function (val) {
6
+ return /^(?:(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])).*$/.test(val)
7
+ });
8
+ Vue.validator('chinesePassword', function (val) {
9
+ var testBealoon=/.*?[\u4E00-\u9FFF]+.*$/.test(val)
10
+ return !(/.*?[\u4E00-\u9FFF]+.*$/.test(val))
11
+ });
12
+ // 潜能要求8~16位数字字母组合;
13
+ Vue.validator('numbersAndLetter8to16', function (val) {
14
+ return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/.test(val)
15
+ });
Binary file