docs: 更新项目文档,完善需求和技术细节
This commit is contained in:
@@ -66,7 +66,7 @@ router.post('/register', async (req, res, next) => {
|
||||
|
||||
// 创建用户
|
||||
const result = await dbConnector.query(
|
||||
'INSERT INTO users (username, password_hash, phone, email, user_type) VALUES (?, ?, ?, ?, ?)',
|
||||
'INSERT INTO users (username, password, phone, email, user_type) VALUES (?, ?, ?, ?, ?)',
|
||||
[username, hashedPassword, phone, email, user_type]
|
||||
);
|
||||
|
||||
@@ -127,7 +127,7 @@ router.post('/login', async (req, res, next) => {
|
||||
const userData = user[0];
|
||||
|
||||
// 验证密码
|
||||
const isValidPassword = await bcrypt.compare(password, userData.password_hash);
|
||||
const isValidPassword = await bcrypt.compare(password, userData.password);
|
||||
if (!isValidPassword) {
|
||||
return res.status(401).json({
|
||||
code: 401,
|
||||
|
||||
Reference in New Issue
Block a user