|
@@ -1129,15 +1129,25 @@ func (f *Front) DownloadJyApp() error {
|
|
|
}
|
|
|
domain, _ := jyapp["domain"].(string)
|
|
|
apkurl, _ := jyapp["apkurl"].(string)
|
|
|
- return f.Redirect(getDownloadUri(code, domain+apkurl))
|
|
|
+ return f.Redirect(getDownloadUri(code, source, domain+apkurl))
|
|
|
}
|
|
|
|
|
|
-func getDownloadUri(code, download string) string {
|
|
|
+//获取app下载地址,不通code对应不通渠道的app包
|
|
|
+func getDownloadUri(code, source, download string) string {
|
|
|
jyapp := config.Sysconfig["jyapp"].(map[string]interface{})
|
|
|
channelMap := jyapp["channelDir"].(map[string]interface{})
|
|
|
if dir, ok := channelMap[code]; ok {
|
|
|
return fmt.Sprintf(download, dir)
|
|
|
}
|
|
|
+ //渠道信息未匹配上 根据source判断微信
|
|
|
+ if source == "wx_othershare" || source == "wx_infocontentshare" || source == "weixinAutoRpl" || source == "weixinAapplySub" {
|
|
|
+ //微信下载地址
|
|
|
+ wxdir, ok := jyapp["wx01"]
|
|
|
+ if ok {
|
|
|
+ return fmt.Sprintf(download, wxdir)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //全部未匹配上 取默认
|
|
|
return fmt.Sprintf(download, channelMap["default"])
|
|
|
}
|
|
|
|