瀏覽代碼

基础配置

xiaohaizhao 1 年之前
父節點
當前提交
a0bc73f6b2
共有 3 個文件被更改,包括 85 次插入10 次删除
  1. 25 1
      main.js
  2. 47 1
      manifest.json
  3. 13 8
      pages.json

+ 25 - 1
main.js

@@ -6,8 +6,32 @@ import './uni.promisify.adaptor'
 Vue.config.productionTip = false
 Vue.use(uView);
 
-App.mpType = 'app'
+//自定义组件
+import My_listbox from './components/My_listbox.vue';
+Vue.component("My_listbox", My_listbox);
+import appList from './components/appList.vue';
+Vue.component("appList", appList);
+
+//挂载接口
+let isDev = process.env.NODE_ENV === 'development';
+console.log('运行环境' + process.env.NODE_ENV, isDev ? '开发' : '生产');
+const http = {};
+// #ifdef H5
+http.baseUrl = isDev ? "/apis1" : "/apis";
+http.socket = isDev ? "/socket1" : "/socket";
+// #endif
+// #ifndef H5
+http.baseUrl = isDev ? "http://61.164.207.46:8200" : "https://www.ibpchina.com.cn";
+http.socket = isDev ? "ws://61.164.207.46:8200" : "wss://www.ibpchina.com.cn";
+// #endif
+console.log("接口地址", http)
 
+import {
+  ApiModel
+} from './utils/api'
+Vue.prototype.$Http = new ApiModel(http);
+
+App.mpType = 'app'
 const app = new Vue({
   ...App
 })

+ 47 - 1
manifest.json

@@ -71,5 +71,51 @@
     "uniStatistics" : {
         "enable" : false
     },
-    "vueVersion" : "2"
+    "vueVersion" : "2",
+    "h5" : {
+        "router" : {
+            "mode" : "hash",
+            "base" : "./"
+        },
+        "devServer" : {
+            "https" : false,
+            "disableHostCheck" : true,
+            "proxy" : {
+                "/socket1" : {
+                    "target" : "ws://61.164.207.46:8200",
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "^/apis1" : ""
+                    }
+                },
+                "/socket" : {
+                    "target" : "wss://www.ibpchina.com.cn",
+                    "changeOrigin" : false,
+                    "pathRewrite" : {
+                        "^/apis" : ""
+                    }
+                },
+                "/apis1" : {
+                    "target" : "http://61.164.207.46:8200",
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "^/apis1" : ""
+                    }
+                },
+                "/apis" : {
+                    "target" : "https://www.ibpchina.com.cn",
+                    "changeOrigin" : false,
+                    "pathRewrite" : {
+                        "^/apis" : ""
+                    }
+                }
+            }
+        },
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : true
+            }
+        },
+        "title" : "营销工具"
+    }
 }

+ 13 - 8
pages.json

@@ -1,12 +1,17 @@
 {
-	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "首页"
-			}
-		}
-	],
+	"pages": [{
+		"path": "pages/login/login"
+	}, {
+		"path": "pages/login/selectSite"
+	}, {
+		"path": "pages/index/index"
+	}],
+	"subPackages": [{
+		"root": "packageA",
+		"pages": [{
+			"path": "affiche/index"
+		}]
+	}],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "营销工具",