报错提示优化
This commit is contained in:
parent
eb8f281092
commit
004c357153
|
@ -7,6 +7,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.ruoyi.common.config.WxConfig;
|
import com.ruoyi.common.config.WxConfig;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.http.HttpUtils;
|
import com.ruoyi.common.utils.http.HttpUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
|
||||||
* 2024/7/29
|
* 2024/7/29
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class WxAuthService {
|
public class WxAuthService {
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,7 +56,8 @@ public class WxAuthService {
|
||||||
|
|
||||||
Integer errcode = body.getInteger("errcode");
|
Integer errcode = body.getInteger("errcode");
|
||||||
if (errcode == null || !errcode.equals(0)) {
|
if (errcode == null || !errcode.equals(0)) {
|
||||||
throw new ServiceException("获取手机号失败:" + body.getString("errmsg"));
|
log.error("获取手机号失败 {}", body);
|
||||||
|
throw new ServiceException("获取手机号失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
String phoneInfo = body.getString("phone_info");
|
String phoneInfo = body.getString("phone_info");
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class UserValidatorImpl extends BaseValidator implements UserValidator {
|
||||||
query.setEqPhonenumber(mobile);
|
query.setEqPhonenumber(mobile);
|
||||||
query.setExcludeUserId(userId);
|
query.setExcludeUserId(userId);
|
||||||
int repeatCount = userService.selectCount(query);
|
int repeatCount = userService.selectCount(query);
|
||||||
ServiceUtil.assertion(repeatCount > 0, "用户手机号重复");
|
ServiceUtil.assertion(repeatCount > 0, "当前手机号已被绑定");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user