Преглед на файлове

修改生产环境接口地址

xiaohaizhao преди 1 година
родител
ревизия
4846cafaae
променени са 2 файла, в които са добавени 94 реда и са изтрити 94 реда
  1. 6 6
      main.js
  2. 88 88
      manifest.json

+ 6 - 6
main.js

@@ -22,16 +22,16 @@ Vue.component('My_listbox', My_listbox);
 import My_search from './components/My_search';
 Vue.component('My_search', My_search);
 //挂载接口
-
-let env = 'dev';
+let isDev = process.env.NODE_ENV === 'development';
+console.log('运行环境', isDev ? '开发' : '生产');
 const http = {};
 // #ifdef H5
-http.baseUrl = env == 'dev' ? "/apis1" : "/apis";
-http.socket = env == 'dev' ? "/socket1" : "/socket";
+http.baseUrl = isDev ? "/apis1" : "/apis";
+http.socket = isDev ? "/socket1" : "/socket";
 // #endif
 // #ifndef H5
-http.baseUrl = env == 'dev' ? "http://60.204.153.188" : "https://oms.idcgroup.com.cn:8079";
-http.socket = env == 'dev' ? "ws://60.204.153.188" : "wss://oms.idcgroup.com.cn:8079";
+http.baseUrl = isDev ? "http://60.204.153.188" : "https://www.ibpchina.com.cn";
+http.socket = isDev ? "ws://60.204.153.188" : "wss://www.ibpchina.com.cn";
 // #endif
 console.log("接口地址", http)
 

+ 88 - 88
manifest.json

@@ -1,29 +1,29 @@
 {
-    "name" : "智慧水务",
-    "appid" : "__UNI__4021CF0",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
+    "name": "智慧水务",
+    "appid": "__UNI__4021CF0",
+    "description": "",
+    "versionName": "1.0.0",
+    "versionCode": "100",
+    "transformPx": false,
     /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "智慧水务",
-        "compilerVersion" : 3,
-        "runmode" : "liberate",
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : false,
-            "waiting" : false,
-            "autoclose" : true,
-            "delay" : 0
+    "app-plus": {
+        "usingComponents": true,
+        "nvueStyleCompiler": "智慧水务",
+        "compilerVersion": 3,
+        "runmode": "liberate",
+        "splashscreen": {
+            "alwaysShowBeforeRender": false,
+            "waiting": false,
+            "autoclose": true,
+            "delay": 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules": {},
         /* 应用发布信息 */
-        "distribute" : {
+        "distribute": {
             /* android打包配置 */
-            "android" : {
-                "permissions" : [
+            "android": {
+                "permissions": [
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -42,104 +42,104 @@
                 ]
             },
             /* ios打包配置 */
-            "ios" : {},
+            "ios": {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs": {}
         }
     },
     /* 快应用特有相关 */
-    "quickapp" : {},
+    "quickapp": {},
     /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "wxd162e1286b6d7ecd",
-        "setting" : {
-            "urlCheck" : false,
-            "es6" : true,
-            "postcss" : true,
-            "minified" : true
+    "mp-weixin": {
+        "appid": "wxd162e1286b6d7ecd",
+        "setting": {
+            "urlCheck": false,
+            "es6": true,
+            "postcss": true,
+            "minified": true
         },
-        "optimization" : {
-            "subPackages" : true
+        "optimization": {
+            "subPackages": true
         },
-        "usingComponents" : true,
-        "permission" : {
-            "scope.userLocation" : {
-                "desc" : "为了您更好的体验,请确认获取您的位置"
+        "usingComponents": true,
+        "permission": {
+            "scope.userLocation": {
+                "desc": "为了您更好的体验,请确认获取您的位置"
             }
         },
-        "requiredPrivateInfos" : [ "getLocation" ]
+        "requiredPrivateInfos": ["getLocation"]
     },
-    "mp-alipay" : {
-        "usingComponents" : true
+    "mp-alipay": {
+        "usingComponents": true
     },
-    "mp-baidu" : {
-        "usingComponents" : true
+    "mp-baidu": {
+        "usingComponents": true
     },
-    "mp-toutiao" : {
-        "usingComponents" : true
+    "mp-toutiao": {
+        "usingComponents": true
     },
-    "uniStatistics" : {
-        "enable" : false
+    "uniStatistics": {
+        "enable": false
     },
-    "vueVersion" : "2",
-    "h5" : {
-        "router" : {
-            "mode" : "hash",
-            "base" : "./"
+    "vueVersion": "2",
+    "h5": {
+        "router": {
+            "mode": "hash",
+            "base": "./"
         },
-        "devServer" : {
-            "https" : false,
-            "disableHostCheck" : true,
-            "proxy" : {
-                "/socket1" : {
-                    "target" : "ws://60.204.153.188",
-                    "changeOrigin" : true,
-                    "pathRewrite" : {
-                        "^/apis1" : ""
+        "devServer": {
+            "https": false,
+            "disableHostCheck": true,
+            "proxy": {
+                "/socket1": {
+                    "target": "ws://60.204.153.188",
+                    "changeOrigin": true,
+                    "pathRewrite": {
+                        "^/apis1": ""
                     }
                 },
-                "/socket" : {
-                    "target" : "wss://oms.idcgroup.com.cn:8079",
-                    "changeOrigin" : false,
-                    "pathRewrite" : {
-                        "^/apis" : ""
+                "/socket": {
+                    "target": "wss://www.ibpchina.com.cn",
+                    "changeOrigin": false,
+                    "pathRewrite": {
+                        "^/apis": ""
                     }
                 },
-                "/apis1" : {
-                    "target" : "http://60.204.153.188",
-                    "changeOrigin" : true,
-                    "pathRewrite" : {
-                        "^/apis1" : ""
+                "/apis1": {
+                    "target": "http://60.204.153.188",
+                    "changeOrigin": true,
+                    "pathRewrite": {
+                        "^/apis1": ""
                     }
                 },
-                "/apis" : {
-                    "target" : "https://oms.idcgroup.com.cn:8079",
-                    "changeOrigin" : false,
-                    "pathRewrite" : {
-                        "^/apis" : ""
+                "/apis": {
+                    "target": "https://www.ibpchina.com.cn",
+                    "changeOrigin": false,
+                    "pathRewrite": {
+                        "^/apis": ""
                     }
                 },
-                "/txwzfw" : {
-                    "target" : "https://apis.map.qq.com",
-                    "changeOrigin" : false,
-                    "pathRewrite" : {
-                        "^/txwzfw" : ""
+                "/txwzfw": {
+                    "target": "https://apis.map.qq.com",
+                    "changeOrigin": false,
+                    "pathRewrite": {
+                        "^/txwzfw": ""
                     }
                 }
             }
         },
-        "optimization" : {
-            "treeShaking" : {
-                "enable" : true
+        "optimization": {
+            "treeShaking": {
+                "enable": true
             }
         },
-        "title" : "智慧水务",
-        "sdkConfigs" : {
-            "maps" : {
-                "qqmap" : {
-                    "key" : "UVVBZ-UOGWZ-ZUWXC-TJQMT-TUWLO-IVFTN"
+        "title": "智慧水务",
+        "sdkConfigs": {
+            "maps": {
+                "qqmap": {
+                    "key": "UVVBZ-UOGWZ-ZUWXC-TJQMT-TUWLO-IVFTN"
                 }
             }
         }
     }
-}
+}