军团:提取权限判断

This commit is contained in:
luying
2021-07-31 18:49:01 +08:00
parent 0b6ac18d45
commit 2cf9fafdbb
10 changed files with 197 additions and 185 deletions

View File

@@ -9,12 +9,12 @@ import { handleCost, addItems, checkGoods } from '../../../services/rewardServic
import { GuildModel } from '../../../db/Guild';
import { findIndex, findWhere } from 'underscore';
import { lockData } from '../../../services/redLockService';
import { checkAuth } from '../../../services/guildService';
import { ARMY } from '../../../pubUtils/dicParam';
import { CURRENCY_BY_TYPE, CURRENCY_TYPE } from '../../../consts/constModules/itemConst';
import { openGuildRefine } from '../../../services/guildRefineService';
import { DATA_NAME } from '../../../consts/dataName';
import { checkTask } from '../../../services/taskService';
import { guildInter } from '../../../pubUtils/interface';
export default function (app: Application) {
new HandlerService(app, {});
@@ -87,15 +87,11 @@ export class GuildRefineHandler {
* @param msg
* @param session
*/
async lightUpTree(msg: { id: number }, session: BackendSession) {
async lightUpTree(msg: guildInter & { id: number }, session: BackendSession) {
let { id } = msg;
const roleId: string = session.get('roleId');
const serverId: number = session.get('serverId');
let userGuild = await UserGuildModel.getMyGuild(roleId, 'auth guildCode');
if (!userGuild)
return resResult(STATUS.WRONG_PARMS);
const checkMyResult = await checkAuth(GUILD_OPERATE.EQUIP_PRODUCE, roleId, null, userGuild);
if (!checkMyResult) return resResult(STATUS.GUILD_AUTH_NOT_ENOUGH);
const { myUserGuild: userGuild } = msg
const { guildCode: code } = userGuild;
let developConsume = getArmyDevelopConsumeById(id);
if (!developConsume)