diff --git a/server.js b/server.js index b769eb8..63253b2 100644 --- a/server.js +++ b/server.js @@ -260,7 +260,7 @@ app.post('/api/users', requireAuth, requireSuper, (req, res) => { const { username, password } = req.body || {}; if (!username || !password || String(password).length < 6) return res.status(400).json({ error: '用户名必填,密码至少6位' }); try { - const info = udb.prepare('INSERT INTO users (username, password, role) VALUES (?, ?, "hr")') + const info = udb.prepare("INSERT INTO users (username, password, role) VALUES (?, ?, 'hr')") .run(String(username).trim(), hashPassword(String(password))); logAccess(req, req.user.username, 'user_create', `创建 ${String(username).trim()}`); res.json({ ok: true, id: info.lastInsertRowid });