diff --git a/back/loaders/deps.ts b/back/loaders/deps.ts index b62194c7..f8b43860 100644 --- a/back/loaders/deps.ts +++ b/back/loaders/deps.ts @@ -8,8 +8,8 @@ async function linkToNodeModule(src: string, dst?: string) { const target = path.join(config.rootPath, 'node_modules', dst || src); const source = path.join(config.rootPath, src); - const _exist = await fileExist(target); - if (!_exist) { + const stats = await fs.lstat(target); + if (!stats) { await fs.symlink(source, target, 'dir'); } } diff --git a/back/loaders/express.ts b/back/loaders/express.ts index 45fd64dc..9b2f5c47 100644 --- a/back/loaders/express.ts +++ b/back/loaders/express.ts @@ -105,7 +105,6 @@ export default ({ app }: { app: Application }) => { } const userService = Container.get(UserService); const authInfo = await userService.getUserInfo(); - const envCount = await EnvModel.count(); let isInitialized = true; if ( diff --git a/back/services/notify.ts b/back/services/notify.ts index 55827b41..9646a254 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -42,7 +42,7 @@ export default class NotificationService { retry: 1, }; - constructor(@Inject('logger') private logger: winston.Logger) {} + constructor(@Inject('logger') private logger: winston.Logger) { } public async notify( title: string, @@ -234,9 +234,8 @@ export default class NotificationService { telegramBotUserId, } = this.params; const authStr = telegramBotProxyAuth ? `${telegramBotProxyAuth}@` : ''; - const url = `https://${ - telegramBotApiHost ? telegramBotApiHost : 'api.telegram.org' - }/bot${telegramBotToken}/sendMessage`; + const url = `https://${telegramBotApiHost ? telegramBotApiHost : 'api.telegram.org' + }/bot${telegramBotToken}/sendMessage`; let agent; if (telegramBotProxyHost && telegramBotProxyPort) { const options: any = { @@ -562,7 +561,7 @@ export default class NotificationService { throw new Error(JSON.stringify(info)); } } catch (error: any) { - throw new Error(error.response ? error.response.body : error); + throw error; } } diff --git a/src/pages/initialization/index.tsx b/src/pages/initialization/index.tsx index 61cc90d2..e563249c 100644 --- a/src/pages/initialization/index.tsx +++ b/src/pages/initialization/index.tsx @@ -95,6 +95,53 @@ const Initialization = () => { ), }, + { + title: intl.get('通知设置'), + content: ( +
+ + + + {fields.map((x) => ( + + + + ))} + + +
+ ), + }, { title: intl.get('账户设置'), content: ( @@ -152,53 +199,6 @@ const Initialization = () => { ), }, - { - title: intl.get('通知设置'), - content: ( -
- - - - {fields.map((x) => ( - - - - ))} - - -
- ), - }, { title: intl.get('完成安装'), content: (