jiapeng 7 年之前
父节点
当前提交
ccac248988
共有 2 个文件被更改,包括 28 次插入24 次删除
  1. 26 24
      src/main/java/com/ekexiu/portal/service/SysService.java
  2. 2 0
      src/main/resources/database.sql

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

14
14
15
import org.apache.log4j.Logger;
15
import org.apache.log4j.Logger;
16
import org.jfw.apt.annotation.Autowrie;
16
import org.jfw.apt.annotation.Autowrie;
17
import org.jfw.apt.annotation.DefaultValue;
17
import org.jfw.apt.annotation.Nullable;
18
import org.jfw.apt.annotation.Nullable;
18
import org.jfw.apt.web.annotation.Path;
19
import org.jfw.apt.web.annotation.Path;
19
import org.jfw.apt.web.annotation.method.SetCookie;
20
import org.jfw.apt.web.annotation.method.SetCookie;
897
	public boolean assPatent(@JdbcConn(true) Connection con, String state, String phone, String vc, @Nullable String inviterId, String name, String patent)
898
	public boolean assPatent(@JdbcConn(true) Connection con, String state, String phone, String vc, @Nullable String inviterId, String name, String patent)
898
			throws SQLException, JfwBaseException, IOException {
899
			throws SQLException, JfwBaseException, IOException {
899
		@SuppressWarnings("unchecked")
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
		User user = null;
910
		User user = null;
911
		boolean exists = false;
911
		boolean exists = false;
912
		String uid = StringUtil.buildUUID();
912
		String uid = StringUtil.buildUUID();
966
	public boolean assPaper(@JdbcConn(true) Connection con, String state, String phone, String vc, @Nullable String inviterId, String name, String paper)
966
	public boolean assPaper(@JdbcConn(true) Connection con, String state, String phone, String vc, @Nullable String inviterId, String name, String paper)
967
			throws SQLException, JfwBaseException, IOException {
967
			throws SQLException, JfwBaseException, IOException {
968
		@SuppressWarnings("unchecked")
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
		User user = null;
978
		User user = null;
980
		boolean exists = false;
979
		boolean exists = false;
981
		String uid = StringUtil.buildUUID();
980
		String uid = StringUtil.buildUUID();
1763
	 */
1762
	 */
1764
	@Get
1763
	@Get
1765
	@Path("/regmobilephone")
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
		StateCode<String, String> sc = new StateCode<String, String>();
1773
		StateCode<String, String> sc = new StateCode<String, String>();
1772
		final String key = JfwAppContext.cacheObjectAndGenKey(sc);
1774
		final String key = JfwAppContext.cacheObjectAndGenKey(sc);

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

1514

1514

1515

1515

1516
update organization set org_type = null;
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