20 lines
614 B
TypeScript
20 lines
614 B
TypeScript
import * as dotenv from 'dotenv';
|
|
dotenv.config();
|
|
import pool from './src/config/database';
|
|
import bcrypt from 'bcryptjs';
|
|
|
|
async function run() {
|
|
const xinxinHash = await bcrypt.hash('sxx980623', 10);
|
|
const listerHash = await bcrypt.hash('lister123', 10);
|
|
|
|
await pool.query('UPDATE user SET password = ? WHERE username = ?', [xinxinHash, 'xinxin']);
|
|
await pool.query('UPDATE user SET password = ? WHERE username = ?', [listerHash, 'lister']);
|
|
|
|
console.log('xinxin 密码已更新为 sxx980623');
|
|
console.log('lister 密码已更新为 lister123');
|
|
|
|
await pool.end();
|
|
}
|
|
|
|
run().catch(console.error);
|