Browse Source

修改环境

shuhao 4 months ago
parent
commit
b9409f9442
6 changed files with 8 additions and 5 deletions
  1. 1 0
      .env
  2. 1 0
      .env.dev
  3. 1 0
      .env.pro
  4. 3 2
      package.json
  5. 1 3
      src/api/config.js
  6. 1 0
      vue.config.js

+ 1 - 0
.env

@@ -0,0 +1 @@
+SERVER = "http://127.0.0.1:81/"

+ 1 - 0
.env.dev

@@ -0,0 +1 @@
+SERVER = "https://feiniaotech-dev.sysuimars.cn/"

+ 1 - 0
.env.pro

@@ -0,0 +1 @@
+SERVER = "https://birdseye-api.feiniaotech.sysuimars.cn/"

+ 3 - 2
package.json

@@ -3,8 +3,9 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build",
+    "serve": "vue-cli-service serve --mode dev",
+    "build": "vue-cli-service build --mode pro",
+    "build2": "vue-cli-service build --mode dev",
     "lint": "vue-cli-service lint"
   },
   "dependencies": {

+ 1 - 3
src/api/config.js

@@ -1,6 +1,4 @@
-// let server = "http://127.0.0.1:81/";
-// let server = "https://birdseye-api.feiniaotech.sysuimars.cn/"
-let server = "https://feiniaotech-dev.sysuimars.cn/"
+let server = VE_ENV.SERVER
 let serverMock = "https://mock.apipark.cn/m1/4662471-4313509-default/"
 // let djiCloudBase = "http://127.0.0.1/";
 let djiCloudBase = "https://djiapi.sysuimars.com/";

+ 1 - 0
vue.config.js

@@ -58,6 +58,7 @@ module.exports = {
             {
                 VE_ENV: {
                     MODE: JSON.stringify(process.env.NODE_ENV),
+                    SERVER: JSON.stringify(process.env.SERVER)
                 },
             },
         ]);