Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
beauty_ssm
提交
c173eba6
B
beauty_ssm
项目概览
爱吃血肠
/
beauty_ssm
通知
9
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
beauty_ssm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c173eba6
编写于
3月 24, 2018
作者:
爱吃血肠
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户注册
上级
4ed048d3
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
7 addition
and
7 deletion
+7
-7
src/main/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
...in/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
+5
-1
src/main/java/com/yingjun/ssm/web/UserController.java
src/main/java/com/yingjun/ssm/web/UserController.java
+1
-1
src/main/webapp/resource/script/userResgiter.js
src/main/webapp/resource/script/userResgiter.js
+1
-5
未找到文件。
src/main/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
浏览文件 @
c173eba6
...
@@ -8,6 +8,9 @@ import org.slf4j.Logger;
...
@@ -8,6 +8,9 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpSession
;
import
javax.servlet.http.HttpSession
;
...
@@ -87,6 +90,7 @@ public class UserServiceImpl implements UserService {
...
@@ -87,6 +90,7 @@ public class UserServiceImpl implements UserService {
* 处理用户注册
* 处理用户注册
* @param user
* @param user
*/
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
READ_COMMITTED
,
rollbackFor
=
Throwable
.
class
)
@Override
@Override
public
void
userRegister
(
User
user
,
String
code
,
HttpSession
session
)
{
public
void
userRegister
(
User
user
,
String
code
,
HttpSession
session
)
{
try
{
try
{
...
@@ -94,7 +98,7 @@ public class UserServiceImpl implements UserService {
...
@@ -94,7 +98,7 @@ public class UserServiceImpl implements UserService {
if
(!
emailCode
.
equals
(
code
)){
if
(!
emailCode
.
equals
(
code
)){
throw
new
BizException
(
"验证码错误"
);
throw
new
BizException
(
"验证码错误"
);
}
}
if
(
1
=
=
userDao
.
insertTUser
(
user
)){
if
(
1
!
=
userDao
.
insertTUser
(
user
)){
throw
new
Exception
(
"插入数据影响函数不唯一"
);
throw
new
Exception
(
"插入数据影响函数不唯一"
);
}
}
}
catch
(
BizException
biz
){
}
catch
(
BizException
biz
){
...
...
src/main/java/com/yingjun/ssm/web/UserController.java
浏览文件 @
c173eba6
...
@@ -81,7 +81,7 @@ public class UserController {
...
@@ -81,7 +81,7 @@ public class UserController {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
new
BaseResult
<>(
false
,
ResultEnum
.
INVALID_USER
.
getMsg
());
return
new
BaseResult
<>(
false
,
ResultEnum
.
INVALID_USER
.
getMsg
());
}
}
return
new
BaseResult
<>(
true
,
"
登陆
成功"
);
return
new
BaseResult
<>(
true
,
"
注册
成功"
);
}
}
/**
/**
* 用户注册时获取邮箱验证码
* 用户注册时获取邮箱验证码
...
...
src/main/webapp/resource/script/userResgiter.js
浏览文件 @
c173eba6
...
@@ -93,11 +93,7 @@ function sure(){
...
@@ -93,11 +93,7 @@ function sure(){
dataType
:
"
json
"
,
dataType
:
"
json
"
,
url
:
'
/user/register
'
,
url
:
'
/user/register
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
success
)
{
window
.
location
.
href
=
"
/user/login
"
;
}
else
{
}
}
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录