feat: add demo user and fix __dirname and fix cdn for panel upload

This commit is contained in:
2024-10-09 18:10:21 +08:00
parent 03c473d24a
commit 44d8a831c2
6 changed files with 31 additions and 8 deletions

View File

@@ -190,5 +190,18 @@ export const initializeUser = async () => {
console.info('new Users id', root.id, org.id);
}
};
export const CreateDemoUser = async () => {
const w = await User.findAndCountAll({
logging: false,
});
console.info('[User count]', w.count);
const username = 'dmeo';
const u = await User.findOne({ where: { username }, logging: false });
if (!u) {
const user = await User.createUser(username, '', 'demo');
console.info('new Users name', user.username);
} else {
console.info('Users has been created', u.username);
}
};
// initializeUser();