瀏覽代碼

修改下载页安卓自动打开app

chengziding 1 年之前
父節點
當前提交
36ec06a9be
共有 3 個文件被更改,包括 14 次插入11 次删除
  1. 6 7
      .hbuilderx/launch.json
  2. 2 2
      config/global.config.js
  3. 6 2
      pages/down.vue

+ 6 - 7
.hbuilderx/launch.json

@@ -5,12 +5,11 @@
             "playground" : "standard",
             "type" : "uni-app:app-android"
         },
-	{
-		"app-plus" : 
-		{
-			"launchtype" : "local"
-		},
-		"type" : "uniCloud"
-	}
+        {
+            "app-plus" : {
+                "launchtype" : "local"
+            },
+            "type" : "uniCloud"
+        }
     ]
 }

+ 2 - 2
config/global.config.js

@@ -1,7 +1,7 @@
 const CONFIG = {
   assetsPath: '/static', // 静态资源路径
-  // baseUrl: 'http://192.168.0.17:8196/api', // 后台接口请求地址
-  baseUrl: 'https://yigefuwuapp.ycbrain.com/prod-api/api', // 后台接口请求地址
+  baseUrl: 'http://192.168.0.151:8196/api', // 后台接口请求地址
+  // baseUrl: 'https://yigefuwuapp.ycbrain.com/prod-api/api', // 后台接口请求地址
   telRegex: "^(1)\\d{10}$", //手机正则
   mailVerify: "^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$",
 };

+ 6 - 2
pages/down.vue

@@ -57,12 +57,16 @@
 
 		methods: {
 			getData(type) {
-				
 				this.$http.get("/app/version/newest", {
 					type: type
 				}).then((res) => {
 					if (res && res.data && res.code == 200) {
-						window.location.href = res.data.downloadLink
+						try{
+							if(type==0){
+								window.location = "ygfwUrlSchemes://"
+							}
+						}catch(e){}
+						window.location.href = res.data.downloadLink;
 					} else {
 						this.$mUtil.toast("暂无下载地址")
 					}