cmy 1 år sedan
förälder
incheckning
2f8609b2ac
2 ändrade filer med 33 tillägg och 36 borttagningar
  1. 2 2
      manifest.json
  2. 31 34
      utils/upApp.js

+ 2 - 2
manifest.json

@@ -154,8 +154,8 @@
             "port" : 4526, //端口号
             "proxy" : {
                 "/api" : {
-                    // "target" : "https://www.shangshiyiqu.com", //请求的目标域名
-                    "target" : "http://cbb.qiniu1314.com", //请求的目标域名
+                    "target" : "https://www.shangshiyiqu.com", //请求的目标域名
+                    // "target" : "http://cbb.qiniu1314.com", //请求的目标域名
                     "changeOrigin" : true
                 }
             }

+ 31 - 34
utils/upApp.js

@@ -30,26 +30,25 @@ export function getUpApp() {
 						const x = +arr[i];
 						// 本地版本号
 						const y = +arr1[i];
-						// 判断当前版本是否为小于等于线上版本
-						if (x >= y) {
+						if (x <= y) {
 							// 设置显示数据
 							store.commit('changeState', {
 								name: 'app',
 								value: true
 							});
-							// 当版本较低时更新数据
-							if (x > y) {
-								uni.showModal({
-									title: '提示',
-									content: '请更新应用',
-									showCancel: false,
-									success(e) {
-										plus.runtime.openURL(
-											iosAppStroeUrl
-										);
-									}
-								});
-							}
+						}
+						// 判断当前版本是否为小于等于线上版本
+						if (x > y) {
+							uni.showModal({
+								title: '提示',
+								content: '请更新应用',
+								showCancel: false,
+								success(e) {
+									plus.runtime.openURL(
+										iosAppStroeUrl
+									);
+								}
+							});
 						}
 					}
 				});
@@ -60,11 +59,6 @@ export function getUpApp() {
 	}
 	// 当前系统为安卓则显示数据
 	if (hj === 'android') {
-		// 设置默认显示数据
-		store.commit('changeState', {
-			name: 'app',
-			value: true
-		});
 		uni.request({
 			url: getUpAppUrl,
 			method: 'GET',
@@ -89,20 +83,23 @@ export function getUpApp() {
 						const y = +arr1[i];
 						console.log(arr, arr1, "版本号")
 						// 判断当前版本是否为小于等于线上版本
-						if (x >= y) {
-							// 只有ios才需要显示
-							// 当版本较低时更新数据
-							if (x > y) {
-								uni.showModal({
-									title: '提示',
-									content: '请更新应用',
-									showCancel: false,
-									success(e) {
-										// plus.runtime.openURL('http://lxscimg.liuniu946.com/lxscV' + version + '.apk');
-										downApp(version);
-									}
-								});
-							}
+						if (x <= y) {
+							// 设置默认显示数据
+							store.commit('changeState', {
+								name: 'app',
+								value: true
+							});
+						}
+						if (x > y) {
+							uni.showModal({
+								title: '提示',
+								content: '请更新应用',
+								showCancel: false,
+								success(e) {
+									// plus.runtime.openURL('http://lxscimg.liuniu946.com/lxscV' + version + '.apk');
+									downApp(version);
+								}
+							});
 						}
 					}
 				});