wangkaiyue 6 жил өмнө
parent
commit
6187e5b0ab

+ 12 - 1
src/config.json

@@ -218,7 +218,18 @@
 	"jyapp": {
 	"jyapp": {
 		"domain":"http://web-jydev-wky.jianyu360.cn",
 		"domain":"http://web-jydev-wky.jianyu360.cn",
 		"apkurl": "/jyapp/res/%s/jianyu360.apk",
 		"apkurl": "/jyapp/res/%s/jianyu360.apk",
-		"appstoreurl": "https://itunes.apple.com/cn/app/id1354897149"
+		"appstoreurl": "https://itunes.apple.com/cn/app/id1354897149",
+		"channelDir":{
+			"s001":"baiduSem",
+			"s003":"shenmaSem",
+			"huawei":"huawei",
+			"xiaomi":"xiaomi",
+			"yingyongbao":"yingyongbao",
+			"douyin":"douyin",
+			"wx01":"jywx",
+			"topnet":"topnet",
+			"default":"topnet"
+		}
 	},
 	},
 	"limitSearchText": {
 	"limitSearchText": {
 		"flag": false,
 		"flag": false,

+ 5 - 17
src/jfw/front/front.go

@@ -1126,24 +1126,12 @@ func (f *Front) DownloadJyApp() error {
 }
 }
 
 
 func getDownloadUri(code, download string) string {
 func getDownloadUri(code, download string) string {
-	switch code {
-	case "s001":
-		return fmt.Sprintf(download, "baiduSem")
-	case "s003":
-		return fmt.Sprintf(download, "shenmaSem")
-	case "huawei":
-		return fmt.Sprintf(download, "huawei")
-	case "xiaomi":
-		return fmt.Sprintf(download, "xiaomi")
-	case "yingyongbao":
-		return fmt.Sprintf(download, "yingyongbao")
-	case "douyin":
-		return fmt.Sprintf(download, "douyin")
-	case "wx01":
-		return fmt.Sprintf(download, "jywx")
-	default:
-		return fmt.Sprintf(download, "topnet")
+	jyapp := config.Sysconfig["jyapp"].(map[string]interface{})
+	channelMap := jyapp["channelDir"].(map[string]interface{})
+	if dir, ok := channelMap[code]; ok {
+		return fmt.Sprintf(download, dir)
 	}
 	}
+	return fmt.Sprintf(download, channelMap["default"])
 }
 }
 
 
 func (f *Front) DownloadJyAppQr() error {
 func (f *Front) DownloadJyAppQr() error {

+ 25 - 17
src/jfw/modules/app/src/app/front/me.go

@@ -156,29 +156,37 @@ func (l *Me) CheckUpdate() error {
 		}
 		}
 	}
 	}
 	updata["apkurl"] = getDownloadUri(channel, qutil.ObjToString(updata["apkurl"]))
 	updata["apkurl"] = getDownloadUri(channel, qutil.ObjToString(updata["apkurl"]))
+	delete(updata, "channelDir")
 	l.ServeJson(updata)
 	l.ServeJson(updata)
 	return nil
 	return nil
 }
 }
 
 
 func getDownloadUri(code, download string) string {
 func getDownloadUri(code, download string) string {
-	switch code {
-	case "baidu":
-		return fmt.Sprintf(download, "baiduSem")
-	case "shenma":
-		return fmt.Sprintf(download, "shenmaSem")
-	case "huawei":
-		return fmt.Sprintf(download, "huawei")
-	case "xiaomi":
-		return fmt.Sprintf(download, "xiaomi")
-	case "yingyongbao":
-		return fmt.Sprintf(download, "yingyongbao")
-	case "douyin":
-		return fmt.Sprintf(download, "douyin")
-	case "wx01":
-		return fmt.Sprintf(download, "jywx")
-	default:
-		return fmt.Sprintf(download, "topnet")
+	jyapp := config.Sysconfig["update"].(map[string]interface{})
+	channelMap := jyapp["channelDir"].(map[string]interface{})
+	if dir, ok := channelMap[code]; ok {
+		return fmt.Sprintf(download, dir)
 	}
 	}
+	return fmt.Sprintf(download, channelMap["default"])
+
+	// switch code {
+	// case "baidu":
+	// 	return fmt.Sprintf(download, "baiduSem")
+	// case "shenma":
+	// 	return fmt.Sprintf(download, "shenmaSem")
+	// case "huawei":
+	// 	return fmt.Sprintf(download, "huawei")
+	// case "xiaomi":
+	// 	return fmt.Sprintf(download, "xiaomi")
+	// case "yingyongbao":
+	// 	return fmt.Sprintf(download, "yingyongbao")
+	// case "douyin":
+	// 	return fmt.Sprintf(download, "douyin")
+	// case "wx01":
+	// 	return fmt.Sprintf(download, "jywx")
+	// default:
+	// 	return fmt.Sprintf(download, "topnet")
+	// }
 }
 }
 
 
 //
 //

+ 12 - 1
src/jfw/modules/app/src/config.json

@@ -75,7 +75,18 @@
 		"tipspace": 86400,
 		"tipspace": 86400,
 		"ios_version": "1.0.3",
 		"ios_version": "1.0.3",
         "ios_mustupdate": false,
         "ios_mustupdate": false,
-        "apkurl": "http://web-jydev-wky.jianyu360.cn/jyapp/res/%s/jianyu360.apk"
+        "apkurl": "http://web-jydev-wky.jianyu360.cn/jyapp/res/%s/jianyu360.apk",
+        "channelDir":{
+			"s001":"baiduSem",
+			"s003":"shenmaSem",
+			"huawei":"huawei",
+			"xiaomi":"xiaomi",
+			"yingyongbao":"yingyongbao",
+			"douyin":"douyin",
+			"weixin":"jywx",
+			"topnet":"topnet",
+			"default":"topnet"
+		}
     },
     },
     "limitSearchText": {
     "limitSearchText": {
         "flag": false,
         "flag": false,