网安:修复sms获取bug
This commit is contained in:
@@ -33,9 +33,7 @@ export default class Sms extends BaseModel {
|
||||
isFixed: boolean;
|
||||
|
||||
public static async findByTel(tel: string, lean = true) {
|
||||
let _tel = aesEncryptcfb(tel, ENCRYPT_KEY, ENCRYPT_IV);
|
||||
|
||||
const sms: SmsType = await smsModel.findOne({ tel: _tel }).lean(lean);
|
||||
const sms: SmsType = await smsModel.findOne({ tel }).lean(lean);
|
||||
return sms;
|
||||
}
|
||||
|
||||
@@ -72,9 +70,8 @@ export default class Sms extends BaseModel {
|
||||
}
|
||||
|
||||
public static async fixSms(tel: string) {
|
||||
let _tel = aesEncryptcfb(tel, ENCRYPT_KEY, ENCRYPT_IV);
|
||||
|
||||
const sms: SmsType = await smsModel.findOneAndUpdate({ tel: _tel }, { $setOnInsert: {
|
||||
const sms: SmsType = await smsModel.findOneAndUpdate({ tel }, { $setOnInsert: {
|
||||
tel,
|
||||
code: generateNum(6),
|
||||
used: false,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 体力系统
|
||||
*/
|
||||
|
||||
import { HERO_SYSTEM_TYPE, ABI_TYPE, HERO_CE_RATIO, HERO_SUB_ATTR_RATIO, LINEUP_NUM, REDIS_KEY } from '../consts';
|
||||
import { HERO_SYSTEM_TYPE, ABI_TYPE, HERO_CE_RATIO, HERO_SUB_ATTR_RATIO, LINEUP_NUM } from '../consts';
|
||||
|
||||
import { deepCopy, getAllAttrStage, reduceCe } from './util';
|
||||
import { HeroModel, HeroType, HeroUpdate } from '../db/Hero';
|
||||
@@ -19,7 +19,6 @@ import { PvpDefenseModel } from '../db/PvpDefense';
|
||||
import { findIndex } from 'underscore';
|
||||
import { GuildModel } from '../db/Guild';
|
||||
import { DicJob } from './dictionary/DicJob';
|
||||
import { redisUserInfoUpdate } from '../services/redisService';
|
||||
|
||||
// 修改并下发战力
|
||||
export async function calPlayerCeAndSave(type: number, roleId: string, originHero: HeroType, update: HeroUpdate, args?: Array<number>) {
|
||||
@@ -46,9 +45,6 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
|
||||
|
||||
await PvpDefenseModel.updateCe(roleId, originHero.hid, heroCe); // 更新pvp防守阵战力
|
||||
let guild = await GuildModel.updateCe(roleId, incCe); // 公会更新战力
|
||||
if(guild) {
|
||||
await redisUserInfoUpdate(REDIS_KEY.GUILD_INFO, guild.code, [{ field: 'guildCe', value: guild.guildCe }])
|
||||
}
|
||||
|
||||
let pushHeros = new Array<{ hid: number, ce: number, incHeroCe: number }>();
|
||||
pushHeros.push({
|
||||
@@ -56,7 +52,7 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
|
||||
ce: reduceCe(heroCe),
|
||||
incHeroCe: reduceCe(incCe),
|
||||
});
|
||||
return { pushHeros, role, topLineupCe, hero }
|
||||
return { pushHeros, role, topLineupCe, hero, guild }
|
||||
}
|
||||
|
||||
//全局属性加成
|
||||
|
||||
Reference in New Issue
Block a user