88import org .springframework .context .annotation .Scope ;
99import org .springframework .stereotype .Controller ;
1010
11- import antlr .StringUtils ;
12-
1311import com .alipay .api .internal .util .AlipaySignature ;
1412import com .sht .alipay .config .AlipayConfig ;
13+ import com .sht .po .Users ;
1514import com .sht .users .po .CustomUsers ;
1615import com .sht .users .service .UsersServiceI ;
1716
@@ -101,6 +100,8 @@ public void regist() throws Exception{
101100
102101 String code2 = po .getCode ();
103102
103+ eject (code1 == null ,"验证码错误" );
104+
104105 eject (!code2 .toLowerCase ().equals (code1 .toLowerCase ()), "验证码错误" );
105106
106107 service .regist (po );
@@ -110,8 +111,12 @@ public void regist() throws Exception{
110111 //http://localhost:80/sht
111112 String webaddr = getWebAddr ();
112113
114+
115+ //储存验证信息
116+ setSessionAttr (po .getId (), uuid );
117+
113118 //String conetnt = "<a href='"+webaddr+"/users/verifyEmail.action?email="+po.getEmail()+"&code="+uuid+"'>请点击这里激活</a>";
114- String conetnt = "<a href='" +webaddr +"/users/view/backtoindex.jsp?email =" +po .getEmail ()+"&code=" +uuid +"'>请点击这里激活</a>" ;
119+ String conetnt = "<a href='" +webaddr +"/users/activityUser.action?id =" +po .getId ()+"&code=" +uuid +"'>请点击这里激活</a>" ;
115120
116121 email .sendMessage (po .getEmail (), "二手交易市场邮箱验证" , conetnt );
117122
@@ -127,6 +132,35 @@ public void regist() throws Exception{
127132 writeJSON (po );
128133 po .setMsg (null );
129134 }
135+
136+
137+
138+ /**
139+ * Title:
140+ * <p>
141+ * Description:激活邮箱验证用户
142+ * <p>
143+ * @author Kor_Zhang
144+ * @date 2017年10月11日 下午2:14:13
145+ * @version 1.0
146+ * @return
147+ * @throws Exception
148+ */
149+ public String activityUser () throws Exception {
150+
151+ String c = getSessionAttr (po .getId ());
152+ if (c != null && c .equals (po .getCode ())){
153+
154+ po .setStatus (USERS_STATUS .ACTIVITY );
155+
156+ service .updateByPrimaryKeySelective (po );
157+
158+ Users u = service .selectUserById (po .getId ());
159+
160+ setSessionAttr (FILED_ONLINE_USER ,u );
161+ }
162+ return "fIndex" ;
163+ }
130164 /**
131165 * Title:logout
132166 * <p>
@@ -146,7 +180,7 @@ public String logout() throws Exception{
146180
147181 setRequestAttr (FIELD_REQUEST_RETURN_MSG , "注销成功" );
148182
149- return "fLogin " ;
183+ return "rLogin " ;
150184 }
151185
152186 /**
0 commit comments