temp
This commit is contained in:
46
src/scripts/user-change-pwd.ts
Normal file
46
src/scripts/user-change-pwd.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import '../modules/init.ts';
|
||||
import { User, UserInit } from '../models/user.ts';
|
||||
import { Org, OrgInit } from '../models/org.ts';
|
||||
import { useContextKey } from '@kevisual/use-config/context';
|
||||
const sequelize = useContextKey('sequelize');
|
||||
|
||||
export const main = async () => {
|
||||
// await UserInit(null ,null, {
|
||||
// alter: true,
|
||||
// });
|
||||
await UserInit();
|
||||
await OrgInit();
|
||||
|
||||
const user = await User.findOne({
|
||||
where: {
|
||||
username: 'root',
|
||||
},
|
||||
});
|
||||
if (!user) {
|
||||
process.exit(0);
|
||||
return;
|
||||
}
|
||||
await user.createPassword('silkyai2025');
|
||||
await user.save();
|
||||
|
||||
process.exit(0);
|
||||
};
|
||||
// main();
|
||||
|
||||
export const changeDemo = async () => {
|
||||
await UserInit();
|
||||
await OrgInit();
|
||||
|
||||
const user = await User.findOne({
|
||||
where: {
|
||||
username: 'demo',
|
||||
},
|
||||
});
|
||||
if (!user) {
|
||||
process.exit(0);
|
||||
}
|
||||
await user.createPassword('123456');
|
||||
await user.save();
|
||||
process.exit(0);
|
||||
};
|
||||
// changeDemo();
|
||||
Reference in New Issue
Block a user