✨ feat(web-server): 修改审核服判断逻辑为:指定版本进入审核服
This commit is contained in:
@@ -6,8 +6,10 @@ import { checkWhiteList } from 'app/pubUtils/sysUtil';
|
|||||||
export default class UpdateController extends Controller {
|
export default class UpdateController extends Controller {
|
||||||
public async getversion() {
|
public async getversion() {
|
||||||
const { ctx } = this;
|
const { ctx } = this;
|
||||||
const { version } = ctx.request.body;
|
// const { version } = ctx.request.body;
|
||||||
ctx.body = await ctx.service.update.getVersion(version);
|
// ctx.body = await ctx.service.update.getVersion(version);
|
||||||
|
// ! 接口已废弃
|
||||||
|
ctx.body = ctx.service.utils.resResult(STATUS.REQUEST_FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getUpdateUrl() {
|
public async getUpdateUrl() {
|
||||||
|
|||||||
@@ -37,11 +37,18 @@ export default class Update extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async checkReview(curRegion: RegionType, version: string) {
|
public async checkReview(curRegion: RegionType, version: string) {
|
||||||
const ctx = this.ctx;
|
try {
|
||||||
|
const ctx = this.ctx;
|
||||||
|
|
||||||
if(!curRegion || !curRegion.reviewVersion || !version) return false;
|
if(!curRegion || !curRegion.reviewVersion || !version) return false;
|
||||||
let reviewVersionFlag = ctx.service.utils.compareVersion(version, curRegion.reviewVersion);
|
const versionsInReview = curRegion.reviewVersion.split(',');
|
||||||
return `${ctx.clientIp}`.startsWith('17.') || reviewVersionFlag > 0;
|
if (!versionsInReview || versionsInReview.length <= 0) return false;
|
||||||
|
let reviewVersionFlag = versionsInReview.includes(version) ? true : false;
|
||||||
|
return `${ctx.clientIp}`.startsWith('17.') || reviewVersionFlag;
|
||||||
|
} catch(e) {
|
||||||
|
console.log('checkReview error: ', e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user