|
@@ -723,7 +723,7 @@ public class UserLogic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- public UserWxBean workerMobileLogin(String mobile, String messageCode) throws Exception {
|
|
|
|
|
|
|
+ public UserWxBean workerMobileLogin(String mobile, String messageCode, String locate) throws Exception {
|
|
|
Object validMessageCode = redisUtil.get(Constant.RedisPrefix.SMS + ":" + mobile);
|
|
Object validMessageCode = redisUtil.get(Constant.RedisPrefix.SMS + ":" + mobile);
|
|
|
if (Objects.isNull(validMessageCode)) {
|
|
if (Objects.isNull(validMessageCode)) {
|
|
|
throw new RemoteServiceException("短信验证码过期");
|
|
throw new RemoteServiceException("短信验证码过期");
|
|
@@ -733,17 +733,12 @@ public class UserLogic {
|
|
|
throw new RemoteServiceException("短信验证码错误");
|
|
throw new RemoteServiceException("短信验证码错误");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// final AdminCompanyWechat wechat = adminCompanyWechatService.lambdaQuery()
|
|
|
|
|
-// .last("limit 1")
|
|
|
|
|
-// .one();
|
|
|
|
|
- final AdminCompanyWechat wechat = null;
|
|
|
|
|
-
|
|
|
|
|
- User user = this.initAppUser(wechat, mobile);
|
|
|
|
|
|
|
+ User user = this.initAppUser(mobile, locate);
|
|
|
|
|
|
|
|
return this.appUser(user);
|
|
return this.appUser(user);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private User initAppUser(AdminCompanyWechat wechat, String mobile) throws Exception {
|
|
|
|
|
|
|
+ private User initAppUser(String mobile, String locate) throws Exception {
|
|
|
String key = Constant.RedisPrefix.LOCK_AUTH + ":" + mobile;
|
|
String key = Constant.RedisPrefix.LOCK_AUTH + ":" + mobile;
|
|
|
Lock obtain = redisLockRegistry.obtain(key);
|
|
Lock obtain = redisLockRegistry.obtain(key);
|
|
|
if (!obtain.tryLock(2, TimeUnit.SECONDS)) {
|
|
if (!obtain.tryLock(2, TimeUnit.SECONDS)) {
|
|
@@ -796,6 +791,7 @@ public class UserLogic {
|
|
|
throw new RemoteServiceException("用户已被冻结");
|
|
throw new RemoteServiceException("用户已被冻结");
|
|
|
}
|
|
}
|
|
|
user.setLastLoginTime(new Date());
|
|
user.setLastLoginTime(new Date());
|
|
|
|
|
+ user.setCurLocate(locate);
|
|
|
//授权手机号
|
|
//授权手机号
|
|
|
user.updateById();
|
|
user.updateById();
|
|
|
|
|
|