fix 后台设置等级

This commit is contained in:
luying
2020-12-14 15:06:08 +08:00
parent b27f684e1f
commit 7bc8be231e

View File

@@ -188,7 +188,7 @@ export default class GMUsers extends Service {
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();
for(let roleId of uids) {
let role = await RoleModel.findByRoleId(roleId);
@@ -318,7 +318,7 @@ export default class GMUsers extends Service {
let lv = parseInt(_lv);
if(isNaN(lv)) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
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);
}