Переглянути джерело

ip 端口从系统配置文件中引入

liuwei 4 роки тому
батько
коміт
05b4dd520c
4 змінених файлів з 1676 додано та 1669 видалено
  1. 1665 1665
      .idea/workspace.xml
  2. 4 1
      src/renderer/api/index.js
  3. 5 1
      src/renderer/store/state.js
  4. 2 2
      static/EnitySystem.json

Різницю між файлами не показано, бо вона завелика
+ 1665 - 1665
.idea/workspace.xml


+ 4 - 1
src/renderer/api/index.js

@@ -4,7 +4,10 @@
  */
 
 import ajax from './ajax'
-const BASE_URL = 'http://112.74.78.188:8080'
+import state from '../store/state'
+
+const {systemJson} = state
+const BASE_URL = `${systemJson.ServerIP}:${systemJson.ServerPort}`
 
 // 登录
 export const reqLogin = (data) => ajax(BASE_URL+'/login',data,'POST')

+ 5 - 1
src/renderer/store/state.js

@@ -12,6 +12,7 @@ import bigScreenJson from '../../../static/EnityBigScreen'
 import signalListJson from '../../../static/EnitySignalPreviewList'
 import imageJson from '../../../static/EnityImage'
 import sliderJson from '../../../static/EnitySlider'
+import systemJson from '../../../static/EnitySystem'
 
 export default {
   // 用户信息
@@ -45,5 +46,8 @@ export default {
   imageJson,
 
   // 滑块组件
-  sliderJson
+  sliderJson,
+
+  // ip 端口
+  systemJson
 }

+ 2 - 2
static/EnitySystem.json

@@ -1,6 +1,6 @@
 {
-  "ServerIP":"192.168.1.111",
-  "ServerPort":2020,
+  "ServerIP":"http://112.74.78.188",
+  "ServerPort":8080,
   "Users":[
 
   ]