yuantianjiao 6 年之前
父節點
當前提交
d344ff72cb
共有 2 個檔案被更改,包括 3 行新增4 行删除
  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 查看文件

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

+ 1
- 1
src/util/ajax.js 查看文件

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