jiapeng 7 years ago
parent
commit
ccac248988

+ 26 - 24
src/main/java/com/ekexiu/portal/service/SysService.java

@ -14,6 +14,7 @@ import javax.mail.MessagingException;
14 14
15 15
import org.apache.log4j.Logger;
16 16
import org.jfw.apt.annotation.Autowrie;
17
import org.jfw.apt.annotation.DefaultValue;
17 18
import org.jfw.apt.annotation.Nullable;
18 19
import org.jfw.apt.web.annotation.Path;
19 20
import org.jfw.apt.web.annotation.method.SetCookie;
@ -897,16 +898,15 @@ public class SysService {
897 898
	public boolean assPatent(@JdbcConn(true) Connection con, String state, String phone, String vc, @Nullable String inviterId, String name, String patent)
898 899
			throws SQLException, JfwBaseException, IOException {
899 900
		@SuppressWarnings("unchecked")
900
		 StateCode<String, String> sc = (StateCode<String, String>)
901
		 JfwAppContext.getCachedObject(state);
902
		 if (sc == null || sc.getExpiredTime() < System.currentTimeMillis())
903
		 throw new JfwBaseException(-1, "验证超时");
904
		 if (!sc.getKey().equals(phone)) {
905
		 throw new JfwBaseException(-2, "手机号与验证手机不匹配");
906
		 }
907
		 if (!sc.getValue().equals(vc)) {
908
		 throw new JfwBaseException(-3, "验证码错误");
909
		 }
901
		StateCode<String, String> sc = (StateCode<String, String>) JfwAppContext.getCachedObject(state);
902
		if (sc == null || sc.getExpiredTime() < System.currentTimeMillis())
903
			throw new JfwBaseException(-1, "验证超时");
904
		if (!sc.getKey().equals(phone)) {
905
			throw new JfwBaseException(-2, "手机号与验证手机不匹配");
906
		}
907
		if (!sc.getValue().equals(vc)) {
908
			throw new JfwBaseException(-3, "验证码错误");
909
		}
910 910
		User user = null;
911 911
		boolean exists = false;
912 912
		String uid = StringUtil.buildUUID();
@ -966,16 +966,15 @@ public class SysService {
966 966
	public boolean assPaper(@JdbcConn(true) Connection con, String state, String phone, String vc, @Nullable String inviterId, String name, String paper)
967 967
			throws SQLException, JfwBaseException, IOException {
968 968
		@SuppressWarnings("unchecked")
969
		 StateCode<String, String> sc = (StateCode<String, String>)
970
		 JfwAppContext.getCachedObject(state);
971
		 if (sc == null || sc.getExpiredTime() < System.currentTimeMillis())
972
		 throw new JfwBaseException(-1, "验证超时");
973
		 if (!sc.getKey().equals(phone)) {
974
		 throw new JfwBaseException(-2, "手机号与验证手机不匹配");
975
		 }
976
		 if (!sc.getValue().equals(vc)) {
977
		 throw new JfwBaseException(-3, "验证码错误");
978
		 }
969
		StateCode<String, String> sc = (StateCode<String, String>) JfwAppContext.getCachedObject(state);
970
		if (sc == null || sc.getExpiredTime() < System.currentTimeMillis())
971
			throw new JfwBaseException(-1, "验证超时");
972
		if (!sc.getKey().equals(phone)) {
973
			throw new JfwBaseException(-2, "手机号与验证手机不匹配");
974
		}
975
		if (!sc.getValue().equals(vc)) {
976
			throw new JfwBaseException(-3, "验证码错误");
977
		}
979 978
		User user = null;
980 979
		boolean exists = false;
981 980
		String uid = StringUtil.buildUUID();
@ -1763,10 +1762,13 @@ public class SysService {
1763 1762
	 */
1764 1763
	@Get
1765 1764
	@Path("/regmobilephone")
1766
	public String regMobilePhone(@JdbcConn(false) Connection con, String mobilePhone) throws JfwBaseException, SQLException {
1767
		User user = this.userDao.queryByEmailOrMobilePhone(con, mobilePhone);
1768
		if (null != user) {
1769
			return null;
1765
	public String regMobilePhone(@JdbcConn(false) Connection con, String mobilePhone, @DefaultValue("true") boolean checkExists)
1766
			throws JfwBaseException, SQLException {
1767
		if (checkExists) {
1768
			User user = this.userDao.queryByEmailOrMobilePhone(con, mobilePhone);
1769
			if (null != user) {
1770
				return null;
1771
			}
1770 1772
		}
1771 1773
		StateCode<String, String> sc = new StateCode<String, String>();
1772 1774
		final String key = JfwAppContext.cacheObjectAndGenKey(sc);

+ 2 - 0
src/main/resources/database.sql

@ -1514,6 +1514,8 @@ COMMENT ON COLUMN ppatent.share_id IS '共享ID';
1514 1514

1515 1515

1516 1516
update organization set org_type = null;
1517
ALTER TABLE  organization ADD COLUMN linkman text;
1518
COMMENT ON COLUMN  organization.linkman IS '联系人';
1517 1519

1518 1520

1519 1521