Skip to content

Commit c571894

Browse files
committed
修复整合bug
修复整合bug
1 parent 048c987 commit c571894

File tree

12 files changed

+93
-22
lines changed

12 files changed

+93
-22
lines changed

.settings/org.eclipse.core.resources.prefs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
eclipse.preferences.version=1
2+
encoding//WebRoot/common/view/visit.jsp=UTF-8
23
encoding//WebRoot/users/css/login_style.css=UTF-8
34
encoding//WebRoot/users/css/register_style.css=UTF-8
45
encoding//WebRoot/users/view/exception.jsp=UTF-8

WebRoot/common/view/visit.jsp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11

22
<!--
3-
获取地理位置
3+
获取地理位置
44
var remote_ip_info = {"ret":1,"start":-1,"end":-1,"country":"\u4e2d\u56fd","province":"\u6c5f\u82cf","city":"\u5357\u901a","district":"","isp":"","type":"","desc":""};
55
-->
66
<script type="text/javascript" charset="utf-8" src='http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js'></script>
77
<!--
8-
获取ip
9-
var returnCitySN = {"cip": "180.120.216.21", "cid": "320600", "cname": "江苏省南通市"};
8+
获取ip
9+
var returnCitySN = {"cip": "180.120.216.21", "cid": "320600", "cname": "江苏省南通市"};
1010
-->
1111
<script type="text/javascript" charset="utf-8" src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
12+
<script type="text/javascript" charset="utf-8">
13+
var remote_ip_info = remote_ip_info;
14+
if(undefined == remote_ip_info){//联网无效处理
15+
remote_ip_info = {"cip": "0.0.0.0", "cid": "000000", "cname": "未知"};
16+
}
17+
var returnCitySN = returnCitySN;
18+
if(undefined == returnCitySN){//联网无效处理
19+
returnCitySN = {"ret":-1,"start":-1,"end":-1,"country":"未知","province":"未知","city":"未知","district":"","isp":"","type":"","desc":""};
20+
}
21+
</script>
22+
1223
<script type="text/javascript" charset="utf-8" src="${baseUrl}/common/js/visit.js"></script>

WebRoot/goods/js/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ $(function () {
286286
function getData(min,region,orderByTime,orderByPrice,minPrice,maxPrice,clazzs){
287287
console.log("minPrice:"+minPrice);
288288
console.log("maxPrice:"+maxPrice);
289-
290289
$('.trading_item_info>ul').empty();//清除容器中的所有数据
291290
var url ="minLine="+min+
292291
"&region="+region +

WebRoot/users/js/register.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ $(function(){
3131
function showregister(){
3232
$(".register_box").show();
3333
showCover();//遮罩层
34+
3435
}
3536
/*关闭注册框*/
3637
function closeregister(){
3738
$(".register_box").hide();
3839
hideCover();//遮罩层
40+
refreshVC();
3941
}
4042
/* 打印错误信息 */
4143
function RegisterErrorMsg(msg){
@@ -55,6 +57,7 @@ $("#"+id).css("border","solid 1px rgb(243,243,243)");
5557
}
5658

5759

60+
5861
/*邮箱验证*/
5962
function Check_email(){
6063
var email_re = $("#email").val().trim();

config/config.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ config.goods.imgs.maxNumber=5
2424
config.goods.clazzs.maxNumber=3
2525
#\u5356\u5bb6\u63d0\u4ea4\u7684\u51ed\u8bc1\u7684\u4fdd\u5b58\u4f4d\u7f6e
2626
config.src.users.returnmoneybill=d:\\sht_src\\users\\returnmoneybill\\
27+
#\u963f\u91cc\u652f\u4ed8\u5b9d\u56de\u8c03url
28+
config.alipay.url=http://av8mjf.natappfree.cc

config/db.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#oracle\u8fde\u63a5\u914d\u7f6e
22
db.driver=oracle.jdbc.driver.OracleDriver
3-
db.url=jdbc:oracle:thin:@localhost:1521:orcl
3+
db.url=jdbc:oracle:thin:@localhost:1521:xe
44
db.username=sht
55
db.password=123
66

config/struts/struts-users.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<package namespace="/users" name="users-package" extends="base-package">
88
<!-- 全局result配置 -->
99
<global-results>
10-
<result name="rIndex" type="redirect">/users/view/index.jsp</result>
11-
<result name="fIndex">/users/view/index.jsp</result>
10+
<result name="rIndex" type="redirect">/goods/view/index.jsp</result>
11+
<result name="fIndex">/goods/view/index.jsp</result>
1212

1313
<result name="rLogin" type="redirect">/users/view/login.jsp</result>
1414
<result name="fLogin">/goods/view/index.jsp</result>

src/com/sht/alipay/config/AlipayConfig.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import java.io.FileWriter;
44
import java.io.IOException;
55

6+
import com.sht.util.Static.CONFIG;
7+
import com.sht.util.Util;
8+
69
/* *
710
*类名:AlipayConfig
811
*功能:基础配置类
@@ -16,7 +19,7 @@
1619
public class AlipayConfig {
1720

1821
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
19-
private static String url = "http://bp59ph.natappfree.cc";
22+
private static String url = Util.getValue(CONFIG.FIELD_ALIPAY_CONFIG_URL).toString();
2023
// 应用ID,您的APPID,收款账号既是您的APPID对应支付宝账号
2124
public static String app_id = "2016081500253717";
2225

src/com/sht/users/action/UsersAction.java

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
import org.springframework.context.annotation.Scope;
99
import org.springframework.stereotype.Controller;
1010

11-
import antlr.StringUtils;
12-
1311
import com.alipay.api.internal.util.AlipaySignature;
1412
import com.sht.alipay.config.AlipayConfig;
13+
import com.sht.po.Users;
1514
import com.sht.users.po.CustomUsers;
1615
import 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
/**

src/com/sht/users/service/UsersServiceI.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package com.sht.users.service;
22

3-
import java.awt.image.RenderedImage;
4-
import java.io.File;
5-
import java.util.List;
6-
3+
import com.sht.po.Users;
74
import com.sht.users.po.CustomUsers;
85

96
/**
@@ -92,4 +89,18 @@ public interface UsersServiceI {
9289
*/
9390
public void changePasswordByObj(CustomUsers po) throws Exception;
9491

92+
/**
93+
* Title:
94+
* <p>
95+
* Description:selectUserById
96+
* <p>
97+
* @author Kor_Zhang
98+
* @date 2017年10月11日 下午2:21:22
99+
* @version 1.0
100+
* @param id
101+
* @return
102+
* @throws Exception
103+
*/
104+
public Users selectUserById(String id) throws Exception;
105+
95106
}

0 commit comments

Comments
 (0)