添加获取大区热更新地址的接口

This commit is contained in:
liangtongchuan
2022-05-05 20:01:55 +08:00
parent c4793c7e8a
commit c263c44a90
6 changed files with 33 additions and 2 deletions

View File

@@ -22,5 +22,17 @@ export default class Update extends Service {
remoteVersionUrl: 'http://zyz-hot-update.trgame.cn/version.manifest'
});
}
public async getUpdateUrl(env: string, curVersion: number, updateResUrl: string) {
const ctx = this.ctx;
if (!env || !curVersion || !updateResUrl) return ctx.service.utils.resResult(STATUS.UPDATE_INFO_ERR);
const baseUrl = `${updateResUrl}/${env}/${curVersion}`;
return ctx.service.utils.resResult(STATUS.SUCCESS, {
packageUrl: baseUrl,
remoteManifestUrl: `${baseUrl}/project.manifest`,
remoteVersionUrl: `${baseUrl}/version.manifest`
});
}
}