|
@@ -320,8 +320,12 @@ public class WebGatewayImpl implements WebGateway {
|
|
|
saSession.set(UserConstants.SA_USER_NAME, adminUser.getUserName());
|
|
|
}
|
|
|
|
|
|
- // 查询用户所属小区信息
|
|
|
- TblTenant tenant = tblTenantService.getById(adminUser.getTenantId());
|
|
|
+ // 查询用户所属小区信息(仅普通用户查询,超级管理员直接跳过)
|
|
|
+ TblTenant tenant = null;
|
|
|
+ if (adminUser.getTenantId() != null) {
|
|
|
+ tenant = tblTenantService.getById(adminUser.getTenantId());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// 当前用户登录后,需要将当前用户的权限保存到redis,用于网关校验权限
|
|
|
userAuthService.cacheRolesAndPermissions();
|
|
@@ -330,7 +334,12 @@ public class WebGatewayImpl implements WebGateway {
|
|
|
AdminLoginRes res = CopyUtils.copy(tokenInfo, AdminLoginRes.class);
|
|
|
BeanUtils.copyProperties(adminUser, res);
|
|
|
res.setTenantId(adminUser.getTenantId());
|
|
|
- res.setTenantName(tenant.getTenantName());
|
|
|
+ if (adminUser.getTenantId() == null) {
|
|
|
+ // 超级管理员
|
|
|
+ res.setTenantName("雷能生活");
|
|
|
+ } else {
|
|
|
+ res.setTenantName(tenant != null ? tenant.getTenantName() : null);
|
|
|
+ }
|
|
|
log.info("当前用户account:{},登录成功", param.getAccount());
|
|
|
return res;
|
|
|
}
|