refactor: 简化首次安装部署,安装向导并入后台并自动建库
This commit is contained in:
@@ -66,8 +66,9 @@ async function bootstrap(): Promise<void> {
|
||||
const publicRoot = resolve(process.env.ARTVERIS_PUBLIC_DIR || join(process.cwd(), 'public'));
|
||||
const http = app.getHttpAdapter().getInstance();
|
||||
if (installing) {
|
||||
mountSpa(app, '/install', resolve(publicRoot, 'install'));
|
||||
http.get('/', (_req, res) => res.redirect('/install'));
|
||||
// 安装模式:由 admin 静态页承载首次安装向导(admin 启动时探测 /api/install/status)
|
||||
mountSpa(app, '/admin', resolve(publicRoot, 'admin'));
|
||||
http.get('/', (_req, res) => res.redirect('/admin'));
|
||||
} else {
|
||||
const localDir = resolve(config.get<string>('storage.localDir') || './storage');
|
||||
if (!existsSync(localDir)) mkdirSync(localDir, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user