Browse Source

优化线上地址和测试地址管理。

lighter 4 years ago
parent
commit
d2d5ca8626
4 changed files with 13 additions and 9 deletions
  1. 1 1
      package.json
  2. 9 0
      src/utils/dev-prod.js
  3. 2 2
      src/utils/request.js
  4. 1 6
      src/utils/websocket.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "wxservice-web",
-  "version": "1.0.0",
+  "version": "1.0.1",
   "scripts": {
     "dev": "vite",
     "build": "vite build",

+ 9 - 0
src/utils/dev-prod.js

@@ -0,0 +1,9 @@
+// 测试
+export const apiUrl = 'http://172.16.30.26:8805/wxserver/'
+export const url8083 = 'ws://172.16.30.26:8805/wxserver/websocket/'
+export const url8085 = 'ws://172.16.30.26:8805/wxserver/websocket/'
+
+// 线上
+// export const apiUrl = 'http://218.104.151.241:8805/wxserver'
+// export const url8083 = 'ws://218.104.151.241:8083/wxserver/websocket/'
+// export const url8085 = 'ws://218.104.151.241:8085/wxserver/websocket/'

+ 2 - 2
src/utils/request.js

@@ -1,10 +1,10 @@
 import axios from 'axios'
 import { Toast, Dialog } from 'vant'
 import store from '../store/index'
+import { apiUrl } from './dev-prod'
 
 const service = axios.create({
-  // baseURL: 'http://172.16.30.26:8805/wxserver/', // dev
-  baseURL: 'http://218.104.151.241:8805/wxserver', // prod
+  baseURL: apiUrl,
   withCredentials: true,
   timeout: 0,
 })

+ 1 - 6
src/utils/websocket.js

@@ -1,11 +1,6 @@
 import { Notify } from 'vant'
 import { getLocalOpenId } from './check-patient-id'
-
-const url8083 = 'ws://218.104.151.241:8083/wxserver/websocket/'
-const url8085 = 'ws://218.104.151.241:8085/wxserver/websocket/'
-
-// const url8083 = 'ws://localhost:8805/wxserver/websocket/'
-// const url8085 = 'ws://localhost:8805/wxserver/websocket/'
+import { url8083, url8085 } from './dev-prod'
 
 let count = 0