适配多租户

This commit is contained in:
zhonghua1
2025-12-20 17:11:46 +08:00
parent db64ed63a5
commit 1c5a6eee8b
4 changed files with 18 additions and 3 deletions

View File

@@ -42,9 +42,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
// 生成token
String token = UUID.randomUUID().toString().replace("-", "");
// 更新用户的token
// 更新用户的token(登录时不走多租户拦截器,避免添加 tenant_id = null 的限制)
user.setToken(token);
this.updateById(user);
this.baseMapper.updateByIdIgnoreTenant(user);
// 构建登录响应
LoginResponse loginResponse = new LoginResponse();