|
|
@@ -66,8 +66,14 @@ public class AuthenticationController {
|
|
|
public String phoneLogin(String phone, String code, @RequestParam(required = false) Long invitor) {
|
|
|
User user = userService.loginByPhone(phone, code);
|
|
|
InviteType userInviteType = user.getInviteType();
|
|
|
- if (invitor != null & userInviteType != InviteType.AUCTION) {
|
|
|
- userService.bindAuctionInvitor(user.getId(), invitor);
|
|
|
+ if (invitor != null) {
|
|
|
+ if (userInviteType != null) {
|
|
|
+ if (!userInviteType.equals(InviteType.AUCTION)) {
|
|
|
+ userService.bindAuctionInvitor(user.getId(), invitor);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ userService.bindAuctionInvitor(user.getId(), invitor);
|
|
|
+ }
|
|
|
}
|
|
|
return jwtTokenUtil.generateToken(JwtUserFactory.create(user));
|
|
|
}
|
|
|
@@ -85,8 +91,14 @@ public class AuthenticationController {
|
|
|
public String phonePwdLogin(String phone, String password, @RequestParam(required = false) Long invitor) {
|
|
|
User user = userService.loginByPhonePwd(phone, password);
|
|
|
InviteType userInviteType = user.getInviteType();
|
|
|
- if (invitor != null & userInviteType != InviteType.AUCTION) {
|
|
|
- userService.bindAuctionInvitor(user.getId(), invitor);
|
|
|
+ if (invitor != null) {
|
|
|
+ if (userInviteType != null) {
|
|
|
+ if (!userInviteType.equals(InviteType.AUCTION)) {
|
|
|
+ userService.bindAuctionInvitor(user.getId(), invitor);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ userService.bindAuctionInvitor(user.getId(), invitor);
|
|
|
+ }
|
|
|
}
|
|
|
return jwtTokenUtil.generateToken(JwtUserFactory.create(user));
|
|
|
}
|