Quellcode durchsuchen

三维楼宇写活

wangtao vor 1 Jahr
Ursprung
Commit
f8df8af637
6 geänderte Dateien mit 35 neuen und 30 gelöschten Zeilen
  1. 3 0
      .env.development
  2. 3 0
      .env.production
  3. 3 0
      .env.staging
  4. BIN
      deviceManager.zip
  5. 1 1
      src/views/index.vue
  6. 25 29
      vue.config.js

+ 3 - 0
.env.development

@@ -7,6 +7,9 @@ ENV = 'development'
 # 东信设备设施管理系统/开发环境
 VUE_APP_BASE_API = 'https://smartpark.caih.com/dmapi/'
 
+# 物联网三维楼宇数据交互
+VUE_APP_IOT_API = 'https://smartpark.caih.com/YtIoT'
+
 # 实时告警信息获取
 VUE_APP_WEBSOCKET_API = '10.21.39.1:8084'
 # 实时告警信息获取2

+ 3 - 0
.env.production

@@ -7,6 +7,9 @@ ENV = 'production'
 # 管理系统/生产环境
 VUE_APP_BASE_API = 'https://smartpark.caih.com/dmapi/'
 
+# 物联网三维楼宇数据交互
+VUE_APP_IOT_API = 'https://smartpark.caih.com/YtIoT'
+
 # 实时告警信息获取
 VUE_APP_WEBSOCKET_API = '10.21.39.1:8084'
 # 实时告警信息获取2

+ 3 - 0
.env.staging

@@ -9,6 +9,9 @@ ENV = 'staging'
 # 管理系统/测试环境
 VUE_APP_BASE_API = 'http://10.95.2.31:3084/dmapi/'
 
+# 物联网三维楼宇数据交互
+VUE_APP_IOT_API = 'https://smartpark.caih.com/YtIoT'
+
 # 实时告警信息获取
 VUE_APP_WEBSOCKET_API = '10.95.2.31:3084'
 # 实时告警信息获取2

BIN
deviceManager.zip


+ 1 - 1
src/views/index.vue

@@ -468,7 +468,7 @@ import index2 from "./components/index/index2";
 import index3 from "./components/index/index3";
 import index5 from "./components/index/index5";
 import axios from "axios";
-axios.defaults.baseURL = "/YtIoT";
+axios.defaults.baseURL =process.env.VUE_APP_IOT_API;
 // import $ from 'jquery'
 // import index6 from "./components/index/index6";
 import ui_large from "@/assets/images/status_ui_large.png"; //用户传输装置gif

+ 25 - 29
vue.config.js

@@ -27,38 +27,34 @@ module.exports = {
     productionSourceMap: false,
 
     // webpack-dev-server 相关配置
-    devServer: {
-        host: '0.0.0.0',
-        port: port,
-        open: true,
-        proxy: {
-            // detail: https://cli.vuejs.org/config/#devserver-proxy
-            [process.env.VUE_APP_BASE_API]: {
-                // target: `http://172.16.120.213:8084/`, //本地
-                // target: `http://172.16.120.85:8084/`, //本地
-                // target: 'http://172.16.120.49/dmapi/', //49
-                target: 'https://smartpark.caih.com/dmapi/', //东信
-                changeOrigin: true,
-                pathRewrite: {
-                    ['^' + process.env.VUE_APP_BASE_API]: ''
-                }
-            },
-            '/YtIoT': {
-                // target: 'http://47.103.74.123:8080/YtIoT', //这里填入你要请求的接口的前缀
-                target: 'https://smartpark.caih.com/YtIoT', //这里填入你要请求的接口的前缀
-                wss: true, //代理websocked
-                changeOrigin: true, //虚拟的站点需要更换origin
-                secure: true, //是否https接口,我用的http但是我变成false他打包后会报错,所以先true
-                pathRewrite: {
-                    '^/api': '' //重写路径
-                }
+    // devServer: {
+    //     host: '0.0.0.0',
+    //     port: port,
+    //     open: true,
+    //     proxy: {
+    //         // detail: https://cli.vuejs.org/config/#devserver-proxy
+    //         [process.env.VUE_APP_BASE_API]: {
+    //             target: '',
+    //             changeOrigin: true,
+    //             pathRewrite: {
+    //                 ['^' + process.env.VUE_APP_BASE_API]: ''
+    //             }
+    //         },
+    //         '/YtIoT': {
+    //             target: '', //这里填入你要请求的接口的前缀
+    //             wss: true, //代理websocked
+    //             changeOrigin: true, //虚拟的站点需要更换origin
+    //             secure: true, //是否https接口,我用的http但是我变成false他打包后会报错,所以先true
+    //             pathRewrite: {
+    //                 '^/api': '' //重写路径
+    //             }
 
-            }
+    //         }
 
 
-        },
-        disableHostCheck: true
-    },
+    //     },
+    //     disableHostCheck: true
+    // },
     configureWebpack: {
         name: name,
         resolve: {