mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复下载单文件订阅
This commit is contained in:
@@ -24,7 +24,7 @@ import {
|
||||
import { NotificationInfo } from '../data/notify';
|
||||
import {
|
||||
AuthDataType,
|
||||
AuthInfo,
|
||||
SystemInfo,
|
||||
SystemInstance,
|
||||
SystemModel,
|
||||
SystemModelInfo,
|
||||
@@ -47,18 +47,21 @@ export default class SystemService {
|
||||
|
||||
public async getSystemConfig() {
|
||||
const doc = await this.getDb({ type: AuthDataType.systemConfig });
|
||||
return doc || ({} as SystemInstance);
|
||||
return doc;
|
||||
}
|
||||
|
||||
private async updateAuthDb(payload: AuthInfo): Promise<SystemInstance> {
|
||||
private async updateAuthDb(payload: SystemInfo): Promise<SystemInfo> {
|
||||
await SystemModel.upsert({ ...payload });
|
||||
const doc = await this.getDb({ type: payload.type });
|
||||
return doc;
|
||||
}
|
||||
|
||||
public async getDb(query: any): Promise<SystemInstance> {
|
||||
const doc: any = await SystemModel.findOne({ where: { ...query } });
|
||||
return doc && doc.get({ plain: true });
|
||||
public async getDb(query: any): Promise<SystemInfo> {
|
||||
const doc = await SystemModel.findOne({ where: { ...query } });
|
||||
if (!doc) {
|
||||
throw new Error(`${JSON.stringify(query)} not found`);
|
||||
}
|
||||
return doc.get({ plain: true });
|
||||
}
|
||||
|
||||
public async updateNotificationMode(notificationInfo: NotificationInfo) {
|
||||
|
||||
Reference in New Issue
Block a user