feat: 后端用户密码哈希存储

This commit is contained in:
539943419 committed 2025-02-07 23:02:38 +08:00
1 parent 6e0a416422
commit 315916d027
10 files changed
+50 -31

No files matched your search

+1 -4
View File
@@ -20,10 +20,7 @@ export default defineEventHandler(async (event) => {
// throw createError({ statusCode: 400, statusMessage: 'Username already exists' });
// }
// 哈希密码,暂未实现,未来实现
// const salt = getKey().substring(0, 10);
// const hashedPassword = bcrypt.hashSync(password, salt);
const hashedPassword = password
const hashedPassword = bcrypt.hashSync(password, 10);
// 插入新用户
const createTime = Date.now();