|
|
|
@ -36,12 +36,18 @@ export default { |
|
|
|
teamId = updateConfig.teamId |
|
|
|
baseURL = updateConfig.ipConfig |
|
|
|
} |
|
|
|
console.log(`${baseURL}/api/app/checkupdate/${teamId}/${platform}/${bundleID}/${version.versionCode}`, |
|
|
|
'################################'); |
|
|
|
const res = await requestGet( |
|
|
|
`${baseURL}/api/app/checkupdate/${teamId}/${platform}/${bundleID}/${version.versionCode}`).then( |
|
|
|
res => res.data) |
|
|
|
console.log(res); |
|
|
|
// console.log(111, `${baseURL}/api/app/checkupdate/${teamId}/${platform}/${bundleID}/${version.versionCode}`,
|
|
|
|
// '################################');
|
|
|
|
// const res = await requestGet(
|
|
|
|
// `${baseURL}/api/app/checkupdate/${teamId}/${platform}/${bundleID}/${version.versionCode}`).then(
|
|
|
|
// res => res.data)
|
|
|
|
|
|
|
|
const res = await requestGet(`https://cbtadmin.jtyqt.com/api/config/checkupdate`).then( |
|
|
|
res => { |
|
|
|
console.log('====>', res); |
|
|
|
return res.data |
|
|
|
}) |
|
|
|
|
|
|
|
const returnRes = { |
|
|
|
versionCode: '', // int 版本号
|
|
|
|
versionName: '', // String 版本名称
|
|
|
|
@ -49,8 +55,7 @@ export default { |
|
|
|
updateType: '', // String forcibly = 强制更新, solicit = 弹窗确认更新, silent = 静默更新
|
|
|
|
downloadUrl: '' // String 版本下载链接(IOS安装包更新请放跳转store应用商店链接,安卓apk和wgt文件放文件下载链接)
|
|
|
|
}; |
|
|
|
|
|
|
|
if (!res || !res.success) { |
|
|
|
if (Number(res.data.versionCode) <= version.versionCode) { |
|
|
|
// 不提示
|
|
|
|
if (!isPrompt) return |
|
|
|
if (isCustom) { |
|
|
|
@ -70,17 +75,16 @@ export default { |
|
|
|
normal: 'solicit', |
|
|
|
silent: 'silent' |
|
|
|
} |
|
|
|
const versionData = res.data.version |
|
|
|
|
|
|
|
// const versionData = res.data.version
|
|
|
|
const versionData = res.data |
|
|
|
// versionData.updateMode = 'force'
|
|
|
|
returnRes.versionCode = Number(versionData.versionCode) |
|
|
|
returnRes.versionName = versionData.versionStr |
|
|
|
returnRes.versionInfo = versionData.changelog || '' |
|
|
|
returnRes.updateType = updateMode2Type[versionData.updateMode] ? updateMode2Type[versionData |
|
|
|
.updateMode] : 'solicit' |
|
|
|
returnRes.downloadUrl = versionData.installUrl |
|
|
|
console.log(returnRes); |
|
|
|
|
|
|
|
console.log(returnRes, 'returnRes'); |
|
|
|
// 兼容之前的版本
|
|
|
|
return callback && callback(returnRes); |
|
|
|
|
|
|
|
|