网安:修复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,
|
||||
|
||||
Reference in New Issue
Block a user