Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
beauty_ssm
提交
ea936704
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 搜索 >>
提交
ea936704
编写于
3月 05, 2018
作者:
爱吃血肠
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户登录模块完成
上级
229bd6e5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
126 addition
and
59 deletion
+126
-59
src/main/java/com/yingjun/ssm/dao/UserDao.java
src/main/java/com/yingjun/ssm/dao/UserDao.java
+17
-10
src/main/java/com/yingjun/ssm/service/UserService.java
src/main/java/com/yingjun/ssm/service/UserService.java
+18
-10
src/main/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
...in/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
+26
-0
src/main/java/com/yingjun/ssm/web/UserController.java
src/main/java/com/yingjun/ssm/web/UserController.java
+13
-3
src/main/resources/mapper/UserMapper.xml
src/main/resources/mapper/UserMapper.xml
+10
-0
src/main/webapp/WEB-INF/jsp/common/home.jsp
src/main/webapp/WEB-INF/jsp/common/home.jsp
+36
-35
src/main/webapp/WEB-INF/jsp/user/userLogin.jsp
src/main/webapp/WEB-INF/jsp/user/userLogin.jsp
+6
-1
未找到文件。
src/main/java/com/yingjun/ssm/dao/UserDao.java
浏览文件 @
ea936704
...
...
@@ -10,58 +10,65 @@ public interface UserDao {
* 获得TUser数据的总行数
* @return
*/
long
getTUserRowCount
();
public
long
getTUserRowCount
();
/**
* 获得TUser数据集合
* @return
*/
List
<
User
>
selectTUser
();
public
List
<
User
>
selectTUser
();
/**
* 获得一个TUser对象,以参数TUser对象中不为空的属性作为条件进行查询
* @param obj
* @return
*/
User
selectTUserByObj
(
User
obj
);
public
User
selectTUserByObj
(
User
obj
);
/**
* 通过TUser的id获得TUser对象
* @param id
* @return
*/
User
selectTUserById
(
Long
id
);
public
User
selectTUserById
(
Long
id
);
/**
* 插入TUser到数据库,包括null值
* @param value
* @return
*/
int
insertTUser
(
User
value
);
public
int
insertTUser
(
User
value
);
/**
* 插入TUser中属性值不为null的数据到数据库
* @param value
* @return
*/
int
insertNonEmptyTUser
(
User
value
);
public
int
insertNonEmptyTUser
(
User
value
);
/**
* 批量插入TUser到数据库,包括null值
* @param value
* @return
*/
int
insertTUserByBatch
(
List
<
User
>
value
);
public
int
insertTUserByBatch
(
List
<
User
>
value
);
/**
* 通过TUser的id删除TUser
* @param id
* @return
*/
int
deleteTUserById
(
Long
id
);
public
int
deleteTUserById
(
Long
id
);
/**
* 通过TUser的id更新TUser中的数据,包括null值
* @param enti
* @return
*/
int
updateTUserById
(
User
enti
);
public
int
updateTUserById
(
User
enti
);
/**
* 通过TUser的id更新TUser中属性不为null的数据
* @param enti
* @return
*/
int
updateNonEmptyTUserById
(
User
enti
);
public
int
updateNonEmptyTUserById
(
User
enti
);
/**
* 普通用户登录
* @param user 邮箱以及密码
* @return
*/
public
User
checkUserLogin
(
User
user
);
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/service/UserService.java
浏览文件 @
ea936704
...
...
@@ -10,58 +10,66 @@ public interface UserService {
* 获得TUser数据的总行数
* @return
*/
long
getTUserRowCount
();
public
long
getTUserRowCount
();
/**
* 获得TUser数据集合
* @return
*/
List
<
User
>
selectTUser
();
public
List
<
User
>
selectTUser
();
/**
* 获得一个TUser对象,以参数TUser对象中不为空的属性作为条件进行查询
* @param obj
* @return
*/
User
selectTUserByObj
(
User
obj
);
public
User
selectTUserByObj
(
User
obj
);
/**
* 通过TUser的id获得TUser对象
* @param id
* @return
*/
User
selectTUserById
(
Long
id
);
public
User
selectTUserById
(
Long
id
);
/**
* 插入TUser到数据库,包括null值
* @param value
* @return
*/
int
insertTUser
(
User
value
);
public
int
insertTUser
(
User
value
);
/**
* 插入TUser中属性值不为null的数据到数据库
* @param value
* @return
*/
int
insertNonEmptyTUser
(
User
value
);
public
int
insertNonEmptyTUser
(
User
value
);
/**
* 批量插入TUser到数据库
* @param value
* @return
*/
int
insertTUserByBatch
(
List
<
User
>
value
);
public
int
insertTUserByBatch
(
List
<
User
>
value
);
/**
* 通过TUser的id删除TUser
* @param id
* @return
*/
int
deleteTUserById
(
Long
id
);
public
int
deleteTUserById
(
Long
id
);
/**
* 通过TUser的id更新TUser中的数据,包括null值
* @param enti
* @return
*/
int
updateTUserById
(
User
enti
);
public
int
updateTUserById
(
User
enti
);
/**
* 通过TUser的id更新TUser中属性不为null的数据
* @param enti
* @return
*/
int
updateNonEmptyTUserById
(
User
enti
);
public
int
updateNonEmptyTUserById
(
User
enti
);
/**
* 校验用户登录
* 根据邮箱 密码查询用户信息
* @param user 用户邮箱 以及密码
* return 当前用户
*/
public
User
checkUserLogin
(
User
user
);
}
\ No newline at end of file
src/main/java/com/yingjun/ssm/service/impl/UserServiceImpl.java
浏览文件 @
ea936704
...
...
@@ -2,7 +2,10 @@ package com.yingjun.ssm.service.impl;
import
java.util.List
;
import
com.yingjun.ssm.dao.UserDao
;
import
com.yingjun.ssm.entity.User
;
import
com.yingjun.ssm.exception.BizException
;
import
com.yingjun.ssm.service.UserService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -12,6 +15,7 @@ import org.springframework.stereotype.Service;
*/
@Service
public
class
UserServiceImpl
implements
UserService
{
private
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
UserDao
userDao
;
@Override
...
...
@@ -55,6 +59,28 @@ public class UserServiceImpl implements UserService {
return
userDao
.
updateNonEmptyTUserById
(
enti
);
}
/**
* 校验用户登录
* @param user 用户邮箱 以及密码
*/
@Override
public
User
checkUserLogin
(
User
user
)
{
try
{
User
loginUser
=
userDao
.
checkUserLogin
(
user
);
if
(
loginUser
==
null
){
throw
new
BizException
(
"用户不存在"
);
}
return
loginUser
;
}
catch
(
BizException
biz
){
LOG
.
error
(
"用户名或密码错误"
,
biz
);
throw
new
BizException
(
"用户名或密码错误"
);
}
catch
(
Exception
e
){
LOG
.
error
(
"登录出现异常"
,
e
);
throw
new
BizException
(
"登录出现异常"
);
}
}
public
UserDao
getTUserDao
()
{
return
this
.
userDao
;
}
...
...
src/main/java/com/yingjun/ssm/web/UserController.java
浏览文件 @
ea936704
...
...
@@ -5,8 +5,10 @@ import com.yingjun.ssm.dto.BaseResult;
import
com.yingjun.ssm.entity.User
;
import
com.yingjun.ssm.enums.ResultEnum
;
import
com.yingjun.ssm.exception.BizException
;
import
com.yingjun.ssm.service.UserService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -20,7 +22,8 @@ import org.springframework.web.bind.annotation.*;
public
class
UserController
{
private
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
UserService
userService
;
/**
* 到达用户登录页面
* @return
...
...
@@ -38,8 +41,7 @@ public class UserController {
@RequestMapping
(
value
=
"/userLogin"
,
produces
=
{
"application/json;charset=UTF-8"
})
public
BaseResult
<
Object
>
userLogin
(
User
user
)
{
try
{
System
.
out
.
println
(
"普通用户正在登录"
+
user
);
userService
.
checkUserLogin
(
user
);
}
catch
(
BizException
e
)
{
return
new
BaseResult
<>(
false
,
e
.
getMessage
());
}
catch
(
Exception
e
)
{
...
...
@@ -57,4 +59,12 @@ public class UserController {
LOG
.
info
(
"用户注册"
);
return
"/user/userResgiter"
;
}
/**
* 用户登录成功到达首页
* @return
*/
@RequestMapping
(
value
=
"/home"
)
public
String
home
()
{
return
"/common/home"
;
}
}
src/main/resources/mapper/UserMapper.xml
浏览文件 @
ea936704
...
...
@@ -113,4 +113,14 @@
where id=#{id}
</update>
<!--校验用户登录-->
<select
id=
"checkUserLogin"
parameterType=
"com.yingjun.ssm.entity.User"
resultType=
"com.yingjun.ssm.entity.User"
>
select
<include
refid=
"t_user_Column"
/>
from t_user
<where>
<if
test=
"email != null "
>
and t_user.email = #{email}
</if>
<if
test=
"password != null "
>
and t_user.password = #{password}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/common/home.
html
→
src/main/webapp/WEB-INF/jsp/common/home.
jsp
浏览文件 @
ea936704
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<!DOCTYPE html>
<html>
<head>
...
...
@@ -5,14 +6,14 @@
<title>
首页
</title>
<script>
var
pageConfig
=
{
jdfVersion
:
'
2.0.0
'
};
</script>
<!--首页样式表-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/home.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
/resource/
css/home.css"
/>
<!--其他样式表-->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/news.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/registration.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/buyService.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/proprietorship.css"
/>
<script
src=
"
js
/jquery.min.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"
js
/function.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
/resource/
css/news.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
/resource/
css/registration.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
/resource/
css/buyService.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
/resource/
css/proprietorship.css"
/>
<script
src=
"
/resource/script
/jquery.min.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
src=
"
/resource/script
/function.js"
type=
"text/javascript"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"http://misc.360buyimg.com/jdf/1.0.0/unit/base/1.0.0/base.js"
></script>
</head>
<body>
...
...
@@ -33,13 +34,13 @@
<div
class=
"toLogin"
>
<div
class=
"toLoginmine"
>
<a
href=
"userLogin.html"
>
<div
class=
"mine-img"
><img
src=
"img/login.png"
/></div>
<div
class=
"mine-describe"
><a
href=
"
javascript:void(0)
"
>
用户登录
</a></div>
<div
class=
"mine-img"
><img
src=
"
/resource/
img/login.png"
/></div>
<div
class=
"mine-describe"
><a
href=
"
/user/login
"
>
用户登录
</a></div>
</a>
</div>
<div
class=
"toLoginmine"
>
<a
href=
"secretaryLogin.html"
>
<div
class=
"mine-img"
><img
src=
"img/login.png"
/></div>
<div
class=
"mine-img"
><img
src=
"
/resource/
img/login.png"
/></div>
<div
class=
"mine-describe"
><a
href=
"javascript:void(0)"
>
秘书公司登录
</a></div>
</a>
</div>
...
...
@@ -51,15 +52,15 @@
<div
id=
"sliderBox"
class=
"slider-box"
>
<div
class=
"content"
>
<ul>
<li><img
src=
"img/banner.jpg"
/></li>
<li><img
src=
"img/banner.jpg"
/></li>
<li><img
src=
"
/resource/
img/banner.jpg"
/></li>
<li><img
src=
"
/resource/
img/banner.jpg"
/></li>
</ul>
</div>
</div>
<div
class=
"homeList"
>
<div
class=
"list-content"
>
<div
class=
"homeImg"
>
<img
src=
"img/new.png"
/>
<img
src=
"
/resource/
img/new.png"
/>
<div
class=
"homeTit"
><span>
标题呀
</span></div>
</div>
<div
class=
"list"
>
...
...
@@ -121,72 +122,72 @@
</div>
<div
class=
"flowStep"
>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/realName.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/realName.png"
/></span>
<span
class=
"step-tit"
>
实名认证
</span>
</div>
<div
class=
"arrow"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/secretariesCompany.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/secretariesCompany.png"
/></span>
<span
class=
"step-tit two"
>
选择秘书公司和服务
</span>
</div>
<div
class=
"arrow"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/enterpriseName.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/enterpriseName.png"
/></span>
<span
class=
"step-tit two"
>
企业名称自主申报
</span>
</div>
<div
class=
"arrow"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/pay.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/pay.png"
/></span>
<span
class=
"step-tit"
>
付款
</span>
</div>
</div>
<div
class=
"flowStep mar-t-10"
>
<div
class=
"arrow-down"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow-down"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"clear"
></div>
</div>
<div
class=
"flowStep mar-t-10"
>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/signature.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/signature.png"
/></span>
<span
class=
"step-tit"
>
用户电子签名
</span>
</div>
<div
class=
"arrow-left"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow-left"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/certificate.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/certificate.png"
/></span>
<span
class=
"step-tit"
>
领取数字证书
</span>
</div>
<div
class=
"arrow-left"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow-left"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/audit.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/audit.png"
/></span>
<span
class=
"step-tit"
>
工商审核
</span>
</div>
<div
class=
"arrow-left"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow-left"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/writeInfo.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/writeInfo.png"
/></span>
<span
class=
"step-tit two"
>
企业设立信息填写
</span>
</div>
</div>
<div
class=
"flowStep mar-t-10"
>
<div
class=
"arrow-down-left"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow-down-left"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"clear"
></div>
</div>
<div
class=
"flowStep mar-t-10"
>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/secretariesSign.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/secretariesSign.png"
/></span>
<span
class=
"step-tit"
>
秘书公司附签
</span>
</div>
<div
class=
"arrow"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/secretarieswork.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/secretarieswork.png"
/></span>
<span
class=
"step-tit"
>
秘书公司办照
</span>
</div>
<div
class=
"arrow"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/userGet.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/userGet.png"
/></span>
<span
class=
"step-tit"
>
用户接收证照
</span>
</div>
<div
class=
"arrow"
><img
src=
"img/arrow.png"
/></div>
<div
class=
"arrow"
><img
src=
"
/resource/
img/arrow.png"
/></div>
<div
class=
"step"
>
<span
class=
"picture"
><img
src=
"img/over.png"
/></span>
<span
class=
"picture"
><img
src=
"
/resource/
img/over.png"
/></span>
<span
class=
"step-tit"
>
完成
</span>
</div>
</div>
...
...
src/main/webapp/WEB-INF/jsp/user/userLogin.jsp
浏览文件 @
ea936704
...
...
@@ -91,7 +91,12 @@
dataType
:
"
json
"
,
url
:
'
/user/userLogin
'
,
success
:
function
(
data
)
{
console
.
log
(
data
);
if
(
data
.
success
){
alert
(
data
.
error
);
window
.
location
.
href
=
"
/user/home
"
;
}
else
{
alert
(
data
.
error
);
}
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录