修复编译错误

This commit is contained in:
whyour 2023-07-09 17:46:02 +08:00
parent b0f3b51736
commit f3791cbb62
3 changed files with 17 additions and 13 deletions

View File

@ -25,7 +25,6 @@ export default (app: Router) => {
try {
const userService = Container.get(UserService);
const authInfo = await userService.getUserInfo();
const envCount = await EnvModel.count();
const { version, changeLog, changeLogLink } = await parseVersion(
config.versionFile,
);
@ -95,9 +94,7 @@ export default (app: Router) => {
const logger: Logger = Container.get('logger');
try {
const systemService = Container.get(SystemService);
const result = await systemService.updateSystemConfig(
req.body,
);
const result = await systemService.updateSystemConfig(req.body);
res.send(result);
} catch (e) {
return next(e);

View File

@ -2,7 +2,13 @@ import { Service, Inject } from 'typedi';
import winston from 'winston';
import config from '../config';
import * as fs from 'fs';
import { AuthDataType, AuthInfo, AuthInstance, AuthModel, AuthModelInfo } from '../data/auth';
import {
AuthDataType,
AuthInfo,
AuthInstance,
AuthModel,
AuthModelInfo,
} from '../data/auth';
import { NotificationInfo } from '../data/notify';
import NotificationService from './notify';
import ScheduleService, { TaskCallbacks } from './schedule';
@ -16,7 +22,7 @@ import {
parseVersion,
} from '../config/util';
import { TASK_COMMAND } from '../config/const';
import taskLimit from '../shared/pLimit'
import taskLimit from '../shared/pLimit';
@Service()
export default class SystemService {
@ -31,7 +37,7 @@ export default class SystemService {
public async getSystemConfig() {
const doc = await this.getDb({ type: AuthDataType.systemConfig });
return doc || {};
return doc || ({} as AuthInstance);
}
private async updateAuthDb(payload: AuthInfo): Promise<AuthInstance> {
@ -42,7 +48,7 @@ export default class SystemService {
public async getDb(query: any): Promise<AuthInstance> {
const doc: any = await AuthModel.findOne({ where: { ...query } });
return doc && (doc.get({ plain: true }));
return doc && doc.get({ plain: true });
}
public async updateNotificationMode(notificationInfo: NotificationInfo) {

View File

@ -231,7 +231,7 @@ usage() {
## 更新qinglong
update_qinglong() {
rm -rf "${dir_tmp}/*"
rm -rf ${dir_tmp}/*
local mirror="gitee"
local downloadQLUrl="https://gitee.com/whyour/qinglong/repository/archive"
local downloadStaticUrl="https://gitee.com/whyour/qinglong-static/repository/archive"
@ -253,7 +253,8 @@ update_qinglong() {
if [[ $exit_status -eq 0 ]]; then
echo -e "\n更新青龙源文件成功...\n"
unzip -oq "${dir_tmp}/ql.zip"
cd
unzip -oq ${dir_tmp}/ql.zip -d ${dir_tmp}
update_qinglong_static
else
@ -267,7 +268,7 @@ update_qinglong_static() {
if [[ $exit_status -eq 0 ]]; then
echo -e "\n更新青龙静态资源成功...\n"
unzip -oq "${dir_tmp}/static.zip"
unzip -oq ${dir_tmp}/static.zip -d ${dir_tmp}
check_update_dep
else
@ -288,9 +289,9 @@ check_update_dep() {
if [[ $exit_status -eq 0 ]]; then
echo -e "\n依赖检测安装成功...\n"
cp -rf ${dir_tmp}/qinglong-${primary_branch}/* ${dir_root}
cp -rf ${dir_tmp}/qinglong-${primary_branch}/* ${dir_root}/
rm -rf $dir_static/*
cp -rf ${dir_tmp}/qinglong-static-${primary_branch}/* ${dir_static}
cp -rf ${dir_tmp}/qinglong-static-${primary_branch}/* ${dir_static}/
cp -f $file_config_sample $dir_config/config.sample.sh
reload_pm2