feat: 完善登录等接口鉴权

This commit is contained in:
R524809
2026-01-06 10:49:19 +08:00
parent 84ddca26b5
commit 76c22429ad
16 changed files with 572 additions and 93 deletions
+2 -1
View File
@@ -91,6 +91,7 @@ export class UserService {
);
// 创建用户
// 注意:所有注册用户的 role 固定为 'user',不允许通过注册接口设置其他角色
const user = this.userRepository.create({
username: createUserDto.username,
passwordHash,
@@ -101,7 +102,7 @@ export class UserService {
openId: createUserDto.openId,
unionId: createUserDto.unionId,
status: 'active',
role: createUserDto.role || 'user', // 默认为普通用户
role: 'user', // 固定为普通用户,不允许通过注册接口修改
});
return this.userRepository.save(user);