if (phoneNum == null || phoneNum.isEmpty()) {
logger.error("发送验证码 -- 手机号获取失败:" + phoneNum + ";");
JSONObject json=new JSONObject();
json.put("success", false);
json.put("msg", "短信发送失败!");
return json;
}
1 健壮性:多判断 避免异常
2 日志: 进行日志跟踪 方便查找问题的源头