fix: 修改部署部分代码

This commit is contained in:
2025-02-21 00:48:49 +08:00
parent 14572ce6fa
commit c61999e2a4
8 changed files with 148 additions and 6 deletions

View File

@@ -8,7 +8,10 @@ import { loadApps } from './load-apps.ts';
// export { aiApp };
export { app };
loadApps(app);
// if (import.meta.url === `file://${process.argv[1]}`) {
app.listen(config.port, () => {
console.log(`server is running at http://localhost:${config.port}`);
});
app.server.on(uploadMiddleware);
// }

View File

@@ -215,7 +215,7 @@ User.init(
);
User.sync({ alter: true, logging: false })
.then((res) => {
// initializeUser();
initializeUser();
})
.catch((err) => {
console.error('Sync User error', err);
@@ -238,6 +238,7 @@ export const initializeUser = async () => {
const org = await User.createOrg('admin', root.id, '管理员');
console.info(' new Users name', root.username, org.username);
console.info('new Users id', root.id, org.id);
CreateDemoUser();
}
};
export const CreateDemoUser = async () => {
@@ -245,7 +246,7 @@ export const CreateDemoUser = async () => {
logging: false,
});
console.info('[User count]', w.count);
const username = 'dmeo';
const username = 'demo';
const u = await User.findOne({ where: { username }, logging: false });
if (!u) {
const user = await User.createUser(username, '', 'demo');