fix 后台设置等级
This commit is contained in:
@@ -188,7 +188,7 @@ export default class GMUsers extends Service {
|
|||||||
if(isNaN(hid)) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
if(isNaN(hid)) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
let exp = getHeroExpByLv(hlv);
|
let exp = getHeroExpByLv(hlv - 1)||0;
|
||||||
let heroInfos = new Array();
|
let heroInfos = new Array();
|
||||||
for(let roleId of uids) {
|
for(let roleId of uids) {
|
||||||
let role = await RoleModel.findByRoleId(roleId);
|
let role = await RoleModel.findByRoleId(roleId);
|
||||||
@@ -318,7 +318,7 @@ export default class GMUsers extends Service {
|
|||||||
let lv = parseInt(_lv);
|
let lv = parseInt(_lv);
|
||||||
if(isNaN(lv)) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
if(isNaN(lv)) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||||
for(let roleId of uids) {
|
for(let roleId of uids) {
|
||||||
let exp = ctx.service.utils.getExpByLv(lv);
|
let exp = ctx.service.utils.getExpByLv(lv - 1);
|
||||||
await RoleModel.levelup(roleId, lv, exp?exp.sum:0);
|
await RoleModel.levelup(roleId, lv, exp?exp.sum:0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user