temp
This commit is contained in:
parent
16722f1d1d
commit
90333c791b
@ -10,7 +10,8 @@
|
||||
"dev": "cross-env NODE_ENV=development nodemon --delay 2.5 -e js,cjs,mjs --exec node dist/app.mjs",
|
||||
"test": "tsx test/**/*.ts",
|
||||
"dev:watch": "cross-env NODE_ENV=development concurrently -n \"Watch,Dev\" -c \"green,blue\" \"npm run watch\" \"sleep 1 && npm run dev\" ",
|
||||
"build": "rimraf dist && rollup -c rollup.config.mjs"
|
||||
"build": "rimraf dist && rollup -c rollup.config.mjs",
|
||||
"ssl": "ssh -L 5432:172.21.32.9:5432 sky"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
|
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();
|
Loading…
x
Reference in New Issue
Block a user