|
|
@@ -364,4 +364,32 @@ public class PublicController extends BaseController {
|
|
|
return new Result().data(districtGlossoryService.list(pid));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param mobileCode
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/checkMCode", method = RequestMethod.POST)
|
|
|
+ public Result checkMCode(String mobileCode) {
|
|
|
+ Result res = new Result();
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(mobileCode)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.MCODE_EMPTY_ERROR, "", "手机验证码"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TimeUtils.checkOverTime("register")) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.MCODE_OVERTIME_ERROR, "", "手机验证码超时失效!"));
|
|
|
+ TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE);
|
|
|
+ TokenManager.getSession().removeAttribute(VerifyCodeUtils.M_CODE_TIME);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (!TokenManager.getSession().getAttribute(VerifyCodeUtils.M_CODE).equals(mobileCode)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.MCODE_ERROR, "", "手机验证码错误"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|