|
@@ -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")
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
//
|
|
//
|