| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public WXMPLoginResult wxmpLogin(WXMPLoginData loginData) throws UserAccountException {
|
| | |
|
| | | SystemEnum system = SystemInfoUtil.getSystemByWXCXCAppId(loginData.getAppId());
|
| | | if (!StringUtil.isNullOrEmpty(loginData.getPhone())) {// 电话号码登录
|
| | | ForbiddenUserIdentifyCode identifyCode1 = forbiddenUserIdentifyCodeService
|
| | | .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, loginData.getPhone());
|
| | | if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective())
|
| | | throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | |
|
| | |
|
| | | if (loginData.getLastUser() != null) {// 电话号码绑定
|
| | | if (loginData.getLastUser().getId() != null) {// 绑定
|
| | |
| | | }
|
| | |
|
| | | } else {// 登录
|
| | | UserInfo userInfo = userAccountService.getUserInfoByPhone(loginData.getAppId(), loginData.getPhone());
|
| | | UserInfo userInfo = userAccountService.getUserInfoByPhone(SystemInfoUtil.getSystemByWXCXCAppId(loginData.getAppId()), loginData.getPhone());
|
| | | if (userInfo != null) {// 已存在的用户
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(userInfo.getId());
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {// 需要绑定邀请码
|
| | |
| | | ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, loginData.getWxUser().getUnionId());
|
| | | if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective())
|
| | | throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | UserInfo userInfo = userAccountService.getUserInfoByWXUnionId(loginData.getAppId(),
|
| | | UserInfo userInfo = userAccountService.getUserInfoByWXUnionId(system,
|
| | | loginData.getWxUser().getUnionId());
|
| | | if (userInfo != null) {// 已存在的用户
|
| | | // 是否绑定了电话
|