奇遇推送优化,不需要每次传app直接使用pinus.app

This commit is contained in:
luying
2020-12-29 10:45:01 +08:00
parent afd850e69e
commit 6d2f353551
10 changed files with 45 additions and 63 deletions
@@ -5,9 +5,9 @@ import { getLvByExp, getExpByLv } from '../pubUtils/gamedata';
import { redisUserInfoUpdate } from './redisService';
import { switchOnFunc } from './funcSwitchService';
import { FUNC_OPT_TYPE } from '../consts';
import { Application, BackendSession } from 'pinus';
import { BackendSession } from 'pinus';
export async function roleLevelup(roleId: string, kingExp: number, app: Application, session: BackendSession) {
export async function roleLevelup(roleId: string, kingExp: number, session: BackendSession) {
let role = await RoleModel.findByRoleId(roleId);
let {lv = 1, exp = 0} = role;
let newExp = exp + kingExp;
@@ -20,7 +20,7 @@ export async function roleLevelup(roleId: string, kingExp: number, app: Applicat
role = await RoleModel.levelup(roleId, newLv, newExp);
if(newLv > lv) { // 升级
await switchOnFunc(roleId, FUNC_OPT_TYPE.LEVEL_UP, newLv, app, session);
await switchOnFunc(roleId, FUNC_OPT_TYPE.LEVEL_UP, newLv, session);
await redisUserInfoUpdate(roleId, [{field: 'lv', value: newLv}])
}
let actordata = [];