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

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

@@ -16,6 +16,7 @@ export const STATUS = {
ONLINE_USER_MAX: { code: 13, simStr: '服务器繁忙,请稍后再试' },
FUNCTION_CLOSE: { code: 14, simStr: '抱歉,该功能暂时关闭' },
GLOBAL_ERR: { code: 1003, simStr: '服务器内部错误' },
UPDATE_INFO_ERR: {code: 1004, simStr: '热更新配置错误'},
// http请求
REQUEST_TIME_OUT: { code: 2000, simStr: '请求超时' },
REQUEST_FAIL: { code: 2001, simStr: '请求错误' },

View File

@@ -40,7 +40,13 @@ export default class Region extends BaseModel {
latestServer: number; // 最新服
@prop({ required: true })
versionCode: number; // 版本号
versionCode: number; // 支持的最小版本号
@prop({ required: true })
curVersion: number; // 当前版本号
@prop({ required: true }) // 热更新资源根目录
updateResUrl: string;
@prop({ required: true })
latestServerUniqId: number; // 最新服唯一id

View File

@@ -75,6 +75,7 @@ export class UpdateRegionParams {
prefix: string = ''; // 区名前缀
remark: string = '';
versionCode: number = 1;
curVersion: number = 0;
maxPlayerCnt: number = 0;
timers: SERVER_TIMER[] = [];
@@ -93,7 +94,7 @@ export class UpdateRegionParams {
}
checkParams() {
if(!this.id || !this.name || !this.prefix || !this.maxPlayerCnt || !isArray(this.timers) || this.timers.length <= 0 || !isArray(this.activityGroupId) || this.activityGroupId.length <= 0 || !isNumber(this.versionCode)) {
if(!this.id || !this.name || !this.prefix || !this.maxPlayerCnt || !isArray(this.timers) || this.timers.length <= 0 || !isArray(this.activityGroupId) || this.activityGroupId.length <= 0 || !isNumber(this.versionCode) || !isNumber(this.curVersion)) {
return false
}
return true;
@@ -107,6 +108,7 @@ export class UpdateRegionParams {
prefix: this.prefix,
remark: this.remark,
versionCode: this.versionCode,
curVersion: this.curVersion,
stategy
}
} else {
@@ -116,6 +118,7 @@ export class UpdateRegionParams {
prefix: this.prefix||oldRegion.prefix,
remark: this.remark||oldRegion.remark,
versionCode: this.versionCode||oldRegion.versionCode,
curVersion: this.curVersion||oldRegion.curVersion,
stategy: { ...(oldRegion.stategy||{}), ...stategy }
}
}