|
|
@@ -2,7 +2,10 @@ package com.gree.mall.miniapp.logic.user;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.lang.ObjectId;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.RandomUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
@@ -710,15 +713,16 @@ public class UserLogic {
|
|
|
.last("limit 1")
|
|
|
.one();
|
|
|
|
|
|
- if (Objects.isNull(user)) {
|
|
|
- throw new RemoteServiceException("请输入正确师傅手机号");
|
|
|
- }
|
|
|
+// if (Objects.isNull(user)) {
|
|
|
+// throw new RemoteServiceException("请输入正确师傅手机号");
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
// 向手机号发送验证码
|
|
|
smsLogic.sendSms2(mobile, key, vrifyCode);
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
public UserWxBean workerMobileLogin(String mobile, String messageCode) throws Exception {
|
|
|
Object validMessageCode = redisUtil.get(Constant.RedisPrefix.SMS + ":" + mobile);
|
|
|
if (Objects.isNull(validMessageCode)) {
|
|
|
@@ -765,11 +769,12 @@ public class UserLogic {
|
|
|
// 如果初始化师傅信息表没有,就注册一个
|
|
|
user = new User();
|
|
|
user.setUserId(IdWorker.getIdStr())
|
|
|
+ .setType(UserTypeEnum.WORKER.getKey())
|
|
|
.setCreateTime(new Date())
|
|
|
.setOpenId(user.getUserId())
|
|
|
.setWorkerNumber(user.getUserId())
|
|
|
.setMobile(mobile)
|
|
|
- .setNickName("user_" + IdUtil.simpleUUID());
|
|
|
+ .setNickName("user_" + RandomUtil.randomString(10));
|
|
|
|
|
|
} else {
|
|
|
// 否则按初始化信息新注册
|
|
|
@@ -780,6 +785,7 @@ public class UserLogic {
|
|
|
}
|
|
|
|
|
|
userService.save(user);
|
|
|
+ user = userService.getById(user.getUserId());
|
|
|
if (Objects.nonNull(userWait)) {
|
|
|
this.userTypeInit2(user);
|
|
|
}
|