日志:数据库catch
This commit is contained in:
+10
-3
@@ -1,5 +1,5 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import BaseModel, { getModelForClass } from './BaseModel';
|
||||
import { prop, DocumentType } from '@typegoose/typegoose';
|
||||
import { WHITE_LIST_TYPE } from '../consts';
|
||||
|
||||
export default class WhiteList extends BaseModel {
|
||||
@@ -16,9 +16,16 @@ export default class WhiteList extends BaseModel {
|
||||
}
|
||||
|
||||
public static async checkTel(tel: string) {
|
||||
const rec: WhiteListModelType = await WhiteListModel.findOne({ type: WHITE_LIST_TYPE.TEL, str: tel }).lean();
|
||||
const rec: WhiteListModelType = await WhiteListModel.findOneAndUpdate({}, { type: [] as any }).lean();
|
||||
// const rec: WhiteListModelType = await WhiteListModel.findOne({ type: WHITE_LIST_TYPE.TEL, str: tel }).lean();
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static async test(a: number, b: number, c: string) {
|
||||
console.log(a, b, c)
|
||||
const rec: WhiteListModelType = await WhiteListModel.findOneAndUpdate({}, { type: [] as any }).lean();
|
||||
return rec;
|
||||
}
|
||||
}
|
||||
|
||||
export const WhiteListModel = getModelForClass(WhiteList);
|
||||
|
||||
Reference in New Issue
Block a user