员工账号 唯一问题
登录
This commit is contained in:
@@ -98,7 +98,7 @@ public class AuthorizationController {
|
||||
if (authUser.isChecked() && StringUtils.isBlank(authUser.getCode()) || authUser.isChecked() && !authUser.getCode().equalsIgnoreCase(code)) {
|
||||
throw new BadRequestException("验证码错误");
|
||||
}
|
||||
|
||||
String loginpre="";
|
||||
// 判断是否是员工登录
|
||||
if (authUser.getLoginType() != null && "staff".equals(authUser.getLoginType())) {
|
||||
if (StrUtil.isBlank(authUser.getMerchantName())) {
|
||||
@@ -109,13 +109,12 @@ public class AuthorizationController {
|
||||
if (merchant == null) {
|
||||
throw new BadRequestException("商户不存在");
|
||||
}
|
||||
|
||||
authUser.setUsername(merchant.getShopId() + "@" + authUser.getUsername());
|
||||
loginpre=merchant.getShopId() + "@";
|
||||
}
|
||||
|
||||
//生成token
|
||||
UsernamePasswordAuthenticationToken authenticationToken =
|
||||
new UsernamePasswordAuthenticationToken(authUser.getUsername(), password);
|
||||
new UsernamePasswordAuthenticationToken(loginpre+authUser.getUsername(), password);
|
||||
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
|
||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||
// 生成令牌与第三方系统获取令牌方式
|
||||
|
||||
Reference in New Issue
Block a user