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

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

@@ -1,4 +1,5 @@
import { Controller } from 'egg';
import { RegionModel } from '@db/Region';
export default class UpdateController extends Controller {
public async getversion() {
@@ -7,4 +8,11 @@ export default class UpdateController extends Controller {
ctx.body = await ctx.service.update.getVersion(version);
}
public async getUpdateUrl() {
const { ctx } = this;
const env = this.app.config.realEnv;
const curRegion = await RegionModel.findRegionByEnv(env);
const { curVersion, updateResUrl } = curRegion;
ctx.body = await ctx.service.update.getUpdateUrl(env, curVersion, updateResUrl);
}
}