添加获取大区热更新地址的接口
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user