fix: fix hot-api for not build in bun app.mjs

This commit is contained in:
2025-12-05 20:53:25 +08:00
parent 94e331e376
commit ee33208e6c
9 changed files with 95 additions and 38 deletions

View File

@@ -7,7 +7,7 @@ app.route({
}).define(async (ctx) => {
const { username, password } = ctx.query;
const query = assistantConfig.query;
const auth = assistantConfig.getConfig().auth;
const auth = assistantConfig.getConfig().auth || {};
const res = await query.post({
path: 'user',
key: 'login',
@@ -25,7 +25,7 @@ app.route({
}
if (!auth.username) {
// 初始管理员账号
auth.username = 'admin';
auth.username = loginUser;
assistantConfig.setConfig({ auth });
}
// 保存配置