16 lines
538 B
JavaScript
16 lines
538 B
JavaScript
import sha256 from 'crypto-js/sha256.js';
|
|
import Database from "better-sqlite3";
|
|
|
|
|
|
const dbPath = "./miaoShare.db";
|
|
|
|
const db = new Database(dbPath, { verbose: null });
|
|
const stmt_insertId2FileName = db.prepare(`INSERT INTO USERS (user_id, password_hash, user_group, uploadFilesSizeCount) VALUES (?, ?, ?, 0)`);
|
|
|
|
let userList = [
|
|
['539943419','zjh030628','admin'],
|
|
// ['guest','guest','guest']
|
|
].map(a=>{a[1]=sha256(a[0]+sha256(a[1]).toString()).toString();return a})
|
|
for(let i of userList){
|
|
stmt_insertId2FileName.run(...i)
|
|
} |