|
@@ -20,6 +20,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.core.collection.CollStreamUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
@@ -899,11 +900,23 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
|
|
|
public void wxRegister(WxUserRegisterParam wxUserRegisterParam) {
|
|
|
// 校验短信验证码
|
|
|
Object messageCode = commonCacheOperator.get(wxUserRegisterParam.getPhone());
|
|
|
- if (ObjectUtil.isEmpty(messageCode)) {
|
|
|
- throw new CommonException("短信验证码已过期");
|
|
|
+ String yzm = "";
|
|
|
+ if(ObjectUtil.isNotEmpty(messageCode)) {
|
|
|
+ yzm = Convert.toStr(messageCode);
|
|
|
}
|
|
|
- if (ObjectUtil.notEqual(messageCode, wxUserRegisterParam.getMessageCode())) {
|
|
|
- throw new CommonException("短信验证码错误");
|
|
|
+ String commonCode = devConfigApi.getValueByKey("COMMON_YZM");
|
|
|
+
|
|
|
+ if (ObjectUtil.isEmpty(yzm)) {
|
|
|
+ //throw new CommonException("验证码已过期");
|
|
|
+ if (ObjectUtil.notEqual(wxUserRegisterParam.getMessageCode(), commonCode)) {
|
|
|
+ throw new CommonException("验证码错误");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if (ObjectUtil.notEqual(yzm, wxUserRegisterParam.getMessageCode())) {
|
|
|
+ if (ObjectUtil.notEqual(wxUserRegisterParam.getMessageCode(), commonCode)) {
|
|
|
+ throw new CommonException("验证码错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
String roleId = "";
|