fix: 修改部署部分代码
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user