Parcourir la Source

--update regMobile();update reqBindBindMobilePhone();update
rePassWordWithPhone();

zzy.zhiyuan.foxmail 8 ans auparavant
Parent
commit
c714f44636
1 fichiers modifiés avec 8 ajouts et 10 suppressions
  1. 8 10
      src/main/java/com/ekexiu/portal/service/SysService.java

+ 8 - 10
src/main/java/com/ekexiu/portal/service/SysService.java

@ -597,20 +597,18 @@ public class SysService {
597 597
	 */
598 598
	@Post
599 599
	@Path("/regmobile")
600
	public String regMobile(@JdbcConn(true) Connection con, String state, String mobilePhone, String validateCode, String password, @Nullable String inviterId)
601
			throws SQLException, JfwBaseException {
600
	public String regMobile(@JdbcConn(true) Connection con, String state, String mobilePhone, String validateCode, 
601
			String password, @Nullable String inviterId)throws SQLException, JfwBaseException {
602 602
		@SuppressWarnings("unchecked")
603 603
		StateCode<String, String> sc = (StateCode<String, String>) JfwAppContext.getCachedObject(state);
604
		if (sc == null)
605
			return "验证超时";
606
		if (sc.getExpiredTime() < System.currentTimeMillis())
607
			return "验证超时";
604
		if (sc == null || sc.getExpiredTime() < System.currentTimeMillis())
605
			throw new JfwBaseException(-1, "验证超时");
608 606
		try {
609 607
			if (!sc.getKey().equals(mobilePhone)) {
610
				return "手机号与验证手机不匹配";
608
				throw new JfwBaseException(-2, "手机号与验证手机不匹配");
611 609
			}
612 610
			if (!sc.getValue().equals(validateCode)) {
613
				return "验证码错误";
611
				throw new JfwBaseException(-3, "验证码错误");
614 612
			}
615 613
			User user = new User();
616 614
			user.setId(StringUtil.buildUUID());
@ -1148,7 +1146,7 @@ public class SysService {
1148 1146
			return null;
1149 1147
		user = this.userDao.queryByEmailOrMobilePhone(con, mobilePhone);
1150 1148
		if (null != user)
1151
			return "该手机号已经绑定其他用户";
1149
			throw new JfwBaseException(-1, "该手机号已经绑定其他用户");
1152 1150
1153 1151
		StateCode<String, String> sc = new StateCode<String, String>();
1154 1152
@ -1255,7 +1253,7 @@ public class SysService {
1255 1253
1256 1254
		User user = this.userDao.queryByEmailOrMobilePhone(con, mobilePhone);
1257 1255
		if (null == user)
1258
			return "该手机号还未注册";
1256
			throw new JfwBaseException(-1, "该手机号还未注册");
1259 1257
1260 1258
		StateCode<String, String> sc = new StateCode<String, String>();
1261 1259
		final String key = JfwAppContext.cacheObjectAndGenKey(sc);