员工重复账号

员工登录
角色重复
This commit is contained in:
2024-08-01 18:13:12 +08:00
parent 25b4a4ca2f
commit 9fcc5df6b9
5 changed files with 21 additions and 11 deletions

View File

@@ -99,6 +99,7 @@ public class AuthorizationController {
throw new BadRequestException("验证码错误");
}
String loginpre="";
String shopId="";
// 判断是否是员工登录
if (authUser.getLoginType() != null && "staff".equals(authUser.getLoginType())) {
if (StrUtil.isBlank(authUser.getMerchantName())) {
@@ -109,7 +110,8 @@ public class AuthorizationController {
if (merchant == null) {
throw new BadRequestException("商户不存在");
}
loginpre=merchant.getShopId() + "@";
loginpre = merchant.getShopId() + "@";
shopId = merchant.getShopId();
}
//生成token
@@ -123,7 +125,12 @@ public class AuthorizationController {
// SecurityContextHolder.getContext().setAuthentication(authentication);
final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal();
// TbShopInfo byAccount = tbShopInfoRepository.findByAccount(jwtUserDto.getUsername());
TbPlussShopStaff tbPlussShopStaff = staffRepository.queryByAccount(authUser.getUsername());
TbPlussShopStaff tbPlussShopStaff;
if (authUser.getLoginType() != null && "staff".equals(authUser.getLoginType())) {
tbPlussShopStaff = staffRepository.queryByAccount(authUser.getUsername(),shopId);
} else {
tbPlussShopStaff = staffRepository.queryByAccount(authUser.getUsername());
}
if (tbPlussShopStaff != null && tbPlussShopStaff.getType().equals("staff")) {
Integer isManage = tbPlussShopStaff.getIsManage();
if (isManage != null && isManage != 1) {