🐛 Object的equals方法容易抛空指针异常,应使用常量或确定有值的对象来调用equals。
This commit is contained in:
@@ -50,7 +50,7 @@ public class QrCodeServiceImpl implements QrCodeService {
|
||||
Map<Object, Object> dataMap = JSONObject.toJavaObject(data, Map.class);
|
||||
|
||||
for (Map.Entry<Object, Object> m : dataMap.entrySet()) {
|
||||
if(m.getKey().equals("path")){
|
||||
if("path".equals(m.getKey())){
|
||||
//前端路由, 不需要拼参数
|
||||
page = m.getValue().toString();
|
||||
continue;
|
||||
|
||||
@@ -951,10 +951,10 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
|
||||
* 绑定手机号数据校验
|
||||
*/
|
||||
private void checkBindingPhone(WxBindingPhoneRequest request) {
|
||||
if (!request.getType().equals("public") && !request.getType().equals("routine") && !request.getType().equals("iosWx") && !request.getType().equals("androidWx")) {
|
||||
if (!"public".equals(request.getType()) && !"routine".equals(request.getType()) && !"iosWx".equals(request.getType()) && !"androidWx".equals(request.getType())) {
|
||||
throw new CrmebException("未知的用户类型");
|
||||
}
|
||||
if (request.getType().equals("public")) {
|
||||
if ("public".equals(request.getType())) {
|
||||
if (StrUtil.isBlank(request.getCaptcha())) {
|
||||
throw new CrmebException("验证码不能为空");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user