mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复sqlite数据操作类型
This commit is contained in:
@@ -303,25 +303,26 @@ export default class UserService {
|
||||
}
|
||||
|
||||
public async getNotificationMode(): Promise<NotificationInfo> {
|
||||
const doc = await AuthModel.findOne({
|
||||
where: { type: AuthDataType.notification },
|
||||
});
|
||||
const doc = await this.getDb({ type: AuthDataType.notification });
|
||||
return (doc && doc.info) || {};
|
||||
}
|
||||
|
||||
public async getLogRemoveFrequency() {
|
||||
const doc = await AuthModel.findOne({
|
||||
where: { type: AuthDataType.removeLogFrequency },
|
||||
});
|
||||
const doc = await this.getDb({ type: AuthDataType.removeLogFrequency });
|
||||
return (doc && doc.info) || {};
|
||||
}
|
||||
|
||||
private async updateAuthDb(payload: AuthInfo): Promise<any> {
|
||||
await AuthModel.upsert({ ...payload });
|
||||
const doc = await AuthModel.findOne({ where: { type: payload.type } });
|
||||
const doc = await this.getDb({ type: payload.type });
|
||||
return doc;
|
||||
}
|
||||
|
||||
public async getDb(query: any): Promise<any> {
|
||||
const doc: any = await AuthModel.findOne({ where: { ...query } });
|
||||
return doc && (doc.get({ plain: true }) as any);
|
||||
}
|
||||
|
||||
public async updateNotificationMode(notificationInfo: NotificationInfo) {
|
||||
const code = Math.random().toString().slice(-6);
|
||||
const isSuccess = await this.notificationService.testNotify(
|
||||
|
||||
Reference in New Issue
Block a user