Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/admin into dev

wangfei 6 years ago
parent
commit
963410e1c2
2 changed files with 3 additions and 4 deletions
  1. 2
    3
      src/pages/system/newOrder/newOrderList/index.vue
  2. 1
    1
      src/util/ajax.js

+ 2
- 3
src/pages/system/newOrder/newOrderList/index.vue View File

257
     },
257
     },
258
     initWebSocket () {
258
     initWebSocket () {
259
       // console.log(this.user)
259
       // console.log(this.user)
260
-      const wsPath = this.$api.system.notify.newGoodsOrders.url
261
-      const wsRealPath = replaceURLParams(wsPath, { grps: caseid, id })
262
-
263
       let caseid = this.caseid
260
       let caseid = this.caseid
264
       let id = this.userInfo.UserId
261
       let id = this.userInfo.UserId
262
+      const wsPath = this.$api.system.notify.newGoodsOrders.url
263
+      const wsRealPath = replaceURLParams(wsPath, { grps: caseid, id })
265
       const wsuri = `${window.location.origin.replace('http', 'ws')}${wsRealPath}?token=${localStorage.getItem('JWT')}`
264
       const wsuri = `${window.location.origin.replace('http', 'ws')}${wsRealPath}?token=${localStorage.getItem('JWT')}`
266
       // const wsuri = `ws://192.168.0.11/api/guest/MQ/websocket/${caseid}/${id}`
265
       // const wsuri = `ws://192.168.0.11/api/guest/MQ/websocket/${caseid}/${id}`
267
       try {
266
       try {

+ 1
- 1
src/util/ajax.js View File

81
 
81
 
82
 export default ajax
82
 export default ajax
83
 
83
 
84
-export function replaceURLParams(url, params) {
84
+export function replaceURLParams (url, params) {
85
   const args = { ...(params || {}), org: 'MQ' }
85
   const args = { ...(params || {}), org: 'MQ' }
86
 
86
 
87
   return Object.keys(args).reduce((acc, k) => { // 此方法对每个元素进行处理
87
   return Object.keys(args).reduce((acc, k) => { // 此方法对每个元素进行处理