Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
smileNicky
taoshop
提交
5350199f
T
taoshop
项目概览
smileNicky
/
taoshop
通知
4
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
2
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
T
taoshop
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5350199f
编写于
8月 05, 2018
作者:
N
nicky
提交者:
u014427391
8月 05, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
门户网站登录功能初步实现
上级
cbab4227
变更
19
展开全部
隐藏空白更改
内联
并排
Showing
19 changed file
with
10317 addition
and
116 deletion
+10317
-116
src/taoshop-common/taoshop-common-core/src/main/java/com/muses/taoshop/common/core/base/Constants.java
...in/java/com/muses/taoshop/common/core/base/Constants.java
+39
-0
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/login.html
...oshop-manager-web/src/main/resources/templates/login.html
+5
-5
src/taoshop-portal/pom.xml
src/taoshop-portal/pom.xml
+5
-1
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/CodeController.java
...java/com/muses/taoshop/web/controller/CodeController.java
+107
-0
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/LoginController.java
...ava/com/muses/taoshop/web/controller/LoginController.java
+171
-0
src/taoshop-portal/src/main/resources/static/images/login-reg-bg.png
...-portal/src/main/resources/static/images/login-reg-bg.png
+0
-0
src/taoshop-portal/src/main/resources/static/images/login-reg-pic.jpg
...portal/src/main/resources/static/images/login-reg-pic.jpg
+0
-0
src/taoshop-portal/src/main/resources/static/js/jquery.cookie.js
...shop-portal/src/main/resources/static/js/jquery.cookie.js
+117
-0
src/taoshop-portal/src/main/resources/static/js/jquery.js
src/taoshop-portal/src/main/resources/static/js/jquery.js
+9405
-0
src/taoshop-portal/src/main/resources/static/js/jquery.tips.js
...aoshop-portal/src/main/resources/static/js/jquery.tips.js
+104
-0
src/taoshop-portal/src/main/resources/templates/index.html
src/taoshop-portal/src/main/resources/templates/index.html
+32
-107
src/taoshop-portal/src/main/resources/templates/login.html
src/taoshop-portal/src/main/resources/templates/login.html
+201
-0
src/taoshop-provider-api/taoshop-provider-api-usc/pom.xml
src/taoshop-provider-api/taoshop-provider-api-usc/pom.xml
+1
-0
src/taoshop-provider-api/taoshop-provider-api-usc/src/main/java/com/muses/taoshop/user/entity/User.java
...usc/src/main/java/com/muses/taoshop/user/entity/User.java
+30
-0
src/taoshop-provider-api/taoshop-provider-api-usc/src/main/java/com/muses/taoshop/user/service/IUserService.java
...ain/java/com/muses/taoshop/user/service/IUserService.java
+13
-0
src/taoshop-provider/taoshop-provider-usc/pom.xml
src/taoshop-provider/taoshop-provider-usc/pom.xml
+36
-3
src/taoshop-provider/taoshop-provider-usc/src/main/java/com/muses/taoshop/user/mapper/UserMapper.java
...c/main/java/com/muses/taoshop/user/mapper/UserMapper.java
+11
-0
src/taoshop-provider/taoshop-provider-usc/src/main/java/com/muses/taoshop/user/service/UserServiceImpl.java
.../java/com/muses/taoshop/user/service/UserServiceImpl.java
+25
-0
src/taoshop-provider/taoshop-provider-usc/src/main/resources/mybatis/UserMapper.xml
...op-provider-usc/src/main/resources/mybatis/UserMapper.xml
+15
-0
未找到文件。
src/taoshop-common/taoshop-common-core/src/main/java/com/muses/taoshop/common/core/base/Constants.java
0 → 100644
浏览文件 @
5350199f
package
com.muses.taoshop.common.core.base
;
import
java.util.Locale
;
/**
* @description Constants类,项目的基本信息配置
* @author Nicky
* @date 2017年3月6日
*/
public
class
Constants
{
//定义统一Locale.CHINA,程序中所有和Locale相关操作均默认使用此Locale
public
static
final
Locale
LOCALE_CHINA
=
Locale
.
CHINA
;
//验证码Session
public
static
final
String
SESSION_SECURITY_CODE
=
"sessionSecCode"
;
//用户信息Session
public
static
final
String
SESSION_USER
=
"sessionUser"
;
//角色权限Session
public
static
final
String
SESSION_ROLE_RIGHTS
=
"sessionRoleRights"
;
//所有菜单Session
public
static
final
String
SESSION_ALLMENU
=
"sessionAllMenu"
;
//权限Session
public
static
final
String
SESSION_RIGHTS
=
"sessionRights"
;
//页面分页数量
public
static
final
Integer
PAGE_SIZE
=
6
;
//页面排序数量
public
static
final
Integer
SORT_SIZE
=
3
;
//登录URL
public
static
final
String
URL_LOGIN
=
"/login.do"
;
//登录过滤的正则表达式
public
static
final
String
REGEXP_PATH
=
".*/((login)|(logout)|(toblog)|(search)|(getArchiveArticles)|(code)|(plugins)|(upload)|(static)).*"
;
//不对匹配该值的访问路径拦截(正则)
//Lucene索引的路径
public
static
final
String
LUCENE_INDEX_PATH
=
"D:\\lucene"
;
}
\ No newline at end of file
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/login.html
浏览文件 @
5350199f
...
...
@@ -4,8 +4,8 @@
<head>
<meta
charset=
"utf-8"
/>
<title>
运营系统登录页
</title>
<link
th:href=
"@{
..
/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/static/css/page/backend/login.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/page/backend/login.css}"
rel=
"stylesheet"
/>
</head>
<body>
<div
id=
"hd"
>
...
...
@@ -63,12 +63,12 @@
</div>
</div>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.js}"
></script>
<!-- 引入JQuery提示库 start-->
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/jquery.tips.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.tips.js}"
></script>
<!-- 引入JQuery提示库 end-->
<!-- 引入Cookie库 start-->
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/jquery.cookie.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.cookie.js}"
></script>
<!-- 引入Cookie库 end -->
<script
type=
"text/javascript"
>
...
...
src/taoshop-portal/pom.xml
浏览文件 @
5350199f
...
...
@@ -48,7 +48,11 @@
<artifactId>
taoshop-common-core
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<!--<dependency>
<groupId>com.muses.taoshop.common</groupId>
<artifactId>taoshop-security-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-thymeleaf
</artifactId>
...
...
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/CodeController.java
0 → 100644
浏览文件 @
5350199f
package
com.muses.taoshop.web.controller
;
import
com.muses.taoshop.common.core.base.Constants
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.imageio.ImageIO
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
java.awt.*
;
import
java.awt.font.FontRenderContext
;
import
java.awt.geom.Rectangle2D
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.Random
;
@Controller
@RequestMapping
(
"/code"
)
public
class
CodeController
{
@RequestMapping
(
"/generate"
)
public
void
generate
(
HttpServletRequest
request
,
HttpServletResponse
response
){
ByteArrayOutputStream
output
=
new
ByteArrayOutputStream
();
String
code
=
drawImg
(
output
);
// Subject currentUser = SecurityUtils.getSubject();
// Session session = currentUser.getSession();
HttpSession
session
=
request
.
getSession
();
session
.
setAttribute
(
Constants
.
SESSION_SECURITY_CODE
,
code
);
try
{
ServletOutputStream
out
=
response
.
getOutputStream
();
output
.
writeTo
(
out
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
/**
* 绘画验证码
* @param output
* @return
*/
private
String
drawImg
(
ByteArrayOutputStream
output
){
String
code
=
""
;
//随机产生4个字符
for
(
int
i
=
0
;
i
<
4
;
i
++){
code
+=
randomChar
();
}
int
width
=
70
;
int
height
=
25
;
BufferedImage
bi
=
new
BufferedImage
(
width
,
height
,
BufferedImage
.
TYPE_3BYTE_BGR
);
Font
font
=
new
Font
(
"Times New Roman"
,
Font
.
PLAIN
,
20
);
//调用Graphics2D绘画验证码
Graphics2D
g
=
bi
.
createGraphics
();
g
.
setFont
(
font
);
Color
color
=
new
Color
(
66
,
2
,
82
);
g
.
setColor
(
color
);
g
.
setBackground
(
new
Color
(
226
,
226
,
240
));
g
.
clearRect
(
0
,
0
,
width
,
height
);
FontRenderContext
context
=
g
.
getFontRenderContext
();
Rectangle2D
bounds
=
font
.
getStringBounds
(
code
,
context
);
double
x
=
(
width
-
bounds
.
getWidth
())
/
2
;
double
y
=
(
height
-
bounds
.
getHeight
())
/
2
;
double
ascent
=
bounds
.
getY
();
double
baseY
=
y
-
ascent
;
g
.
drawString
(
code
,
(
int
)
x
,
(
int
)
baseY
);
g
.
dispose
();
try
{
ImageIO
.
write
(
bi
,
"jpg"
,
output
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
code
;
}
/**
* 随机参数一个字符
* @return
*/
private
char
randomChar
(){
Random
r
=
new
Random
();
String
s
=
"ABCDEFGHJKLMNPRSTUVWXYZ0123456789"
;
return
s
.
charAt
(
r
.
nextInt
(
s
.
length
()));
}
/**
* 获取随机颜色值
* @param fc
* @param bc
* @return
*/
Color
getRandColor
(
int
fc
,
int
bc
){
Random
random
=
new
Random
();
if
(
fc
>
255
)
fc
=
255
;
if
(
bc
>
255
)
bc
=
255
;
int
r
=
fc
+
random
.
nextInt
(
bc
-
fc
);
int
g
=
fc
+
random
.
nextInt
(
bc
-
fc
);
int
b
=
fc
+
random
.
nextInt
(
bc
-
fc
);
return
new
Color
(
r
,
g
,
b
);
}
}
\ No newline at end of file
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/LoginController.java
0 → 100644
浏览文件 @
5350199f
package
com.muses.taoshop.web.controller
;
import
com.muses.taoshop.common.core.base.Constants
;
import
com.muses.taoshop.user.entity.User
;
import
com.muses.taoshop.user.service.IUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.imageio.ImageIO
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
java.awt.*
;
import
java.awt.font.FontRenderContext
;
import
java.awt.geom.Rectangle2D
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
/**
* <pre>
* 登录控制类
* </pre>
*
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2018.08.05 11:41 修改内容:
* </pre>
*/
@Controller
@RequestMapping
(
"/portal"
)
public
class
LoginController
extends
BaseController
{
@Autowired
IUserService
userService
;
/**
* 跳转到登录页面
* @return
*/
@GetMapping
(
value
=
"/toLogin"
)
public
ModelAndView
toLogin
(){
ModelAndView
mv
=
this
.
getModelAndView
();
mv
.
setViewName
(
"login"
);
return
mv
;
}
/**
* 登录验证
* @return
*/
@RequestMapping
(
value
=
"/loginCheck"
)
@ResponseBody
public
Map
<
String
,
String
>
loginCheck
(
HttpServletRequest
request
){
Map
<
String
,
String
>
result
=
new
HashMap
<
String
,
String
>();
String
flag
=
"faild"
;
String
logindata
[]
=
request
.
getParameter
(
"LOGINDATA"
).
split
(
","
);
HttpSession
session
=
request
.
getSession
();
if
(
logindata
!=
null
&&
logindata
.
length
==
3
)
{
String
codeSession
=
(
String
)
session
.
getAttribute
(
Constants
.
SESSION_SECURITY_CODE
);
String
username
=
logindata
[
0
];
String
password
=
logindata
[
1
];
String
code
=
logindata
[
2
];
if
(!
code
.
equalsIgnoreCase
(
codeSession
)){
//验证码校验
flag
=
"codeError"
;
}
else
{
//账号密码校验
User
user
=
userService
.
loginCheck
(
username
,
password
);
if
(
user
!=
null
){
//校验成功
session
.
setAttribute
(
Constants
.
SESSION_USER
,
username
);
flag
=
"success"
;
}
else
{
//账号或者密码错误
flag
=
"faild"
;
}
}
}
result
.
put
(
"flag"
,
flag
);
return
result
;
}
@RequestMapping
(
"/code/generate"
)
public
void
generate
(
HttpServletRequest
request
,
HttpServletResponse
response
){
ByteArrayOutputStream
output
=
new
ByteArrayOutputStream
();
String
code
=
drawImg
(
output
);
// Subject currentUser = SecurityUtils.getSubject();
// Session session = currentUser.getSession();
HttpSession
session
=
request
.
getSession
();
session
.
setAttribute
(
Constants
.
SESSION_SECURITY_CODE
,
code
);
try
{
ServletOutputStream
out
=
response
.
getOutputStream
();
output
.
writeTo
(
out
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
/**
* 绘画验证码
* @param output
* @return
*/
private
String
drawImg
(
ByteArrayOutputStream
output
){
String
code
=
""
;
//随机产生4个字符
for
(
int
i
=
0
;
i
<
4
;
i
++){
code
+=
randomChar
();
}
int
width
=
70
;
int
height
=
25
;
BufferedImage
bi
=
new
BufferedImage
(
width
,
height
,
BufferedImage
.
TYPE_3BYTE_BGR
);
Font
font
=
new
Font
(
"Times New Roman"
,
Font
.
PLAIN
,
20
);
//调用Graphics2D绘画验证码
Graphics2D
g
=
bi
.
createGraphics
();
g
.
setFont
(
font
);
Color
color
=
new
Color
(
66
,
2
,
82
);
g
.
setColor
(
color
);
g
.
setBackground
(
new
Color
(
226
,
226
,
240
));
g
.
clearRect
(
0
,
0
,
width
,
height
);
FontRenderContext
context
=
g
.
getFontRenderContext
();
Rectangle2D
bounds
=
font
.
getStringBounds
(
code
,
context
);
double
x
=
(
width
-
bounds
.
getWidth
())
/
2
;
double
y
=
(
height
-
bounds
.
getHeight
())
/
2
;
double
ascent
=
bounds
.
getY
();
double
baseY
=
y
-
ascent
;
g
.
drawString
(
code
,
(
int
)
x
,
(
int
)
baseY
);
g
.
dispose
();
try
{
ImageIO
.
write
(
bi
,
"jpg"
,
output
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
code
;
}
/**
* 随机参数一个字符
* @return
*/
private
char
randomChar
(){
Random
r
=
new
Random
();
String
s
=
"ABCDEFGHJKLMNPRSTUVWXYZ0123456789"
;
return
s
.
charAt
(
r
.
nextInt
(
s
.
length
()));
}
/**
* 获取随机颜色值
* @param fc
* @param bc
* @return
*/
Color
getRandColor
(
int
fc
,
int
bc
){
Random
random
=
new
Random
();
if
(
fc
>
255
)
fc
=
255
;
if
(
bc
>
255
)
bc
=
255
;
int
r
=
fc
+
random
.
nextInt
(
bc
-
fc
);
int
g
=
fc
+
random
.
nextInt
(
bc
-
fc
);
int
b
=
fc
+
random
.
nextInt
(
bc
-
fc
);
return
new
Color
(
r
,
g
,
b
);
}
}
src/taoshop-portal/src/main/resources/static/images/login-reg-bg.png
0 → 100644
浏览文件 @
5350199f
21.3 KB
src/taoshop-portal/src/main/resources/static/images/login-reg-pic.jpg
0 → 100644
浏览文件 @
5350199f
15.8 KB
src/taoshop-portal/src/main/resources/static/js/jquery.cookie.js
0 → 100644
浏览文件 @
5350199f
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2006, 2014 Klaus Hartl
* Released under the MIT license
*/
(
function
(
factory
)
{
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
// AMD
define
([
'
jquery
'
],
factory
);
}
else
if
(
typeof
exports
===
'
object
'
)
{
// CommonJS
factory
(
require
(
'
jquery
'
));
}
else
{
// Browser globals
factory
(
jQuery
);
}
}(
function
(
$
)
{
var
pluses
=
/
\+
/g
;
function
encode
(
s
)
{
return
config
.
raw
?
s
:
encodeURIComponent
(
s
);
}
function
decode
(
s
)
{
return
config
.
raw
?
s
:
decodeURIComponent
(
s
);
}
function
stringifyCookieValue
(
value
)
{
return
encode
(
config
.
json
?
JSON
.
stringify
(
value
)
:
String
(
value
));
}
function
parseCookieValue
(
s
)
{
if
(
s
.
indexOf
(
'
"
'
)
===
0
)
{
// This is a quoted cookie as according to RFC2068, unescape...
s
=
s
.
slice
(
1
,
-
1
).
replace
(
/
\\
"/g
,
'
"
'
).
replace
(
/
\\\\
/g
,
'
\\
'
);
}
try
{
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s
=
decodeURIComponent
(
s
.
replace
(
pluses
,
'
'
));
return
config
.
json
?
JSON
.
parse
(
s
)
:
s
;
}
catch
(
e
)
{}
}
function
read
(
s
,
converter
)
{
var
value
=
config
.
raw
?
s
:
parseCookieValue
(
s
);
return
$
.
isFunction
(
converter
)
?
converter
(
value
)
:
value
;
}
var
config
=
$
.
cookie
=
function
(
key
,
value
,
options
)
{
// Write
if
(
arguments
.
length
>
1
&&
!
$
.
isFunction
(
value
))
{
options
=
$
.
extend
({},
config
.
defaults
,
options
);
if
(
typeof
options
.
expires
===
'
number
'
)
{
var
days
=
options
.
expires
,
t
=
options
.
expires
=
new
Date
();
t
.
setTime
(
+
t
+
days
*
864
e
+
5
);
}
return
(
document
.
cookie
=
[
encode
(
key
),
'
=
'
,
stringifyCookieValue
(
value
),
options
.
expires
?
'
; expires=
'
+
options
.
expires
.
toUTCString
()
:
''
,
// use expires attribute, max-age is not supported by IE
options
.
path
?
'
; path=
'
+
options
.
path
:
''
,
options
.
domain
?
'
; domain=
'
+
options
.
domain
:
''
,
options
.
secure
?
'
; secure
'
:
''
].
join
(
''
));
}
// Read
var
result
=
key
?
undefined
:
{};
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var
cookies
=
document
.
cookie
?
document
.
cookie
.
split
(
'
;
'
)
:
[];
for
(
var
i
=
0
,
l
=
cookies
.
length
;
i
<
l
;
i
++
)
{
var
parts
=
cookies
[
i
].
split
(
'
=
'
);
var
name
=
decode
(
parts
.
shift
());
var
cookie
=
parts
.
join
(
'
=
'
);
if
(
key
&&
key
===
name
)
{
// If second argument (value) is a function it's a converter...
result
=
read
(
cookie
,
value
);
break
;
}
// Prevent storing a cookie that we couldn't decode.
if
(
!
key
&&
(
cookie
=
read
(
cookie
))
!==
undefined
)
{
result
[
name
]
=
cookie
;
}
}
return
result
;
};
config
.
defaults
=
{};
$
.
removeCookie
=
function
(
key
,
options
)
{
if
(
$
.
cookie
(
key
)
===
undefined
)
{
return
false
;
}
// Must not alter options, thus extending a fresh object...
$
.
cookie
(
key
,
''
,
$
.
extend
({},
options
,
{
expires
:
-
1
}));
return
!
$
.
cookie
(
key
);
};
}));
src/taoshop-portal/src/main/resources/static/js/jquery.js
0 → 100644
浏览文件 @
5350199f
此差异已折叠。
点击以展开。
src/taoshop-portal/src/main/resources/static/js/jquery.tips.js
0 → 100644
浏览文件 @
5350199f
/**
* jquery tips 提示插件 jquery.tips.js v0.1beta
*
* 使用方法
* $(selector).tips({ //selector 为jquery选择器
* msg:'your messages!', //你的提示消息 必填
* side:1, //提示窗显示位置 1,2,3,4 分别代表 上右下左 默认为1(上) 可选
* color:'#FFF', //提示文字色 默认为白色 可选
* bg:'#F00',//提示窗背景色 默认为红色 可选
* time:2,//自动关闭时间 默认2秒 设置0则不自动关闭 可选
* x:0,//横向偏移 正数向右偏移 负数向左偏移 默认为0 可选
* y:0,//纵向偏移 正数向下偏移 负数向上偏移 默认为0 可选
* })
*
*
*/
(
function
(
$
)
{
$
.
fn
.
tips
=
function
(
options
){
var
defaults
=
{
side
:
1
,
msg
:
''
,
color
:
'
#FFF
'
,
bg
:
'
#F00
'
,
time
:
2
,
x
:
0
,
y
:
0
}
var
options
=
$
.
extend
(
defaults
,
options
);
if
(
!
options
.
msg
||
isNaN
(
options
.
side
))
{
throw
new
Error
(
'
params error
'
);
}
if
(
!
$
(
'
#jquery_tips_style
'
).
length
){
var
style
=
'
<style id="jquery_tips_style" type="text/css">
'
;
style
+=
'
.jq_tips_box{padding:10px;position:absolute;overflow:hidden;display:inline;display:none;z-index:10176523;}
'
;
style
+=
'
.jq_tips_arrow{display:block;width:0px;height:0px;position:absolute;}
'
;
style
+=
'
.jq_tips_top{border-left:10px solid transparent;left:20px;bottom:0px;}
'
;
style
+=
'
.jq_tips_left{border-top:10px solid transparent;right:0px;top:18px;}
'
;
style
+=
'
.jq_tips_bottom{border-left:10px solid transparent;left:20px;top:0px;}
'
;
style
+=
'
.jq_tips_right{border-top:10px solid transparent;left:0px;top:18px;}
'
;
style
+=
'
.jq_tips_info{word-wrap: break-word;word-break:normal;border-radius:4px;padding:5px 8px;max-width:130px;overflow:hidden;box-shadow:1px 1px 1px #999;font-size:12px;cursor:pointer;}
'
;
style
+=
'
</style>
'
;
$
(
document
.
body
).
append
(
style
);
}
this
.
each
(
function
(){
var
element
=
$
(
this
);
var
element_top
=
element
.
offset
().
top
,
element_left
=
element
.
offset
().
left
,
element_height
=
element
.
outerHeight
(),
element_width
=
element
.
outerWidth
();
options
.
side
=
options
.
side
<
1
?
1
:
options
.
side
>
4
?
4
:
Math
.
round
(
options
.
side
);
var
sideName
=
options
.
side
==
1
?
'
top
'
:
options
.
side
==
2
?
'
right
'
:
options
.
side
==
3
?
'
bottom
'
:
options
.
side
==
4
?
'
left
'
:
'
top
'
;
var
tips
=
$
(
'
<div class="jq_tips_box"><i class="jq_tips_arrow jq_tips_
'
+
sideName
+
'
"></i><div class="jq_tips_info">
'
+
options
.
msg
+
'
</div></div>
'
).
appendTo
(
document
.
body
);
tips
.
find
(
'
.jq_tips_arrow
'
).
css
(
'
border-
'
+
sideName
,
'
10px solid
'
+
options
.
bg
);
tips
.
find
(
'
.jq_tips_info
'
).
css
({
color
:
options
.
color
,
backgroundColor
:
options
.
bg
});
switch
(
options
.
side
){
case
1
:
tips
.
css
({
top
:
element_top
-
tips
.
outerHeight
()
+
options
.
x
,
left
:
element_left
-
10
+
options
.
y
});
break
;
case
2
:
tips
.
css
({
top
:
element_top
-
20
+
options
.
x
,
left
:
element_left
+
element_width
+
options
.
y
});
break
;
case
3
:
tips
.
css
({
top
:
element_top
+
element_height
+
options
.
x
,
left
:
element_left
-
10
+
options
.
y
});
break
;
case
4
:
tips
.
css
({
top
:
element_top
-
20
+
options
.
x
,
left
:
element_left
-
tips
.
outerWidth
()
+
options
.
y
});
break
;
default
:
}
var
closeTime
;
tips
.
fadeIn
(
'
fast
'
).
click
(
function
(){
clearTimeout
(
closeTime
);
tips
.
fadeOut
(
'
fast
'
,
function
(){
tips
.
remove
();
})
})
if
(
options
.
time
){
closeTime
=
setTimeout
(
function
(){
tips
.
click
();
},
options
.
time
*
1000
);
tips
.
hover
(
function
(){
clearTimeout
(
closeTime
);
},
function
(){
closeTime
=
setTimeout
(
function
(){
tips
.
click
();
},
options
.
time
*
1000
);
})
}
});
return
this
;
};
})(
jQuery
);
\ No newline at end of file
src/taoshop-portal/src/main/resources/templates/index.html
浏览文件 @
5350199f
...
...
@@ -27,32 +27,33 @@
<div
class=
"topBar"
>
<div
class=
"layout"
>
<span
class=
"hello-notice f-orange1 f-b"
style=
"position:absolute;left:50%;margin-left:-600px;top:1px;display:block;font-size:14px;text-align:left;"
>
本商城在试运行阶段,暂不接收任何订单。
</span>
<!--welcome-->
<span
class=
"topBar-userWelcome"
>
您好,欢迎来商城!
<a
href=
"#"
rel=
"popbox"
>
[登录]
</a>
<a
href=
"#"
>
[注册]
</a></span>
<!--登录后
<span class="topBar-userWelcome logined">
欢迎您
<span class="user">
<a href="#" class="user-link">fanyanxia<em class="icon-arr"></em></a>
<span class="user-cs" style="display:none;">
<span class="user-cs-con">
<s class="icon-arr"></s>
<p><a href="#">个人中心</a></p>
<p><a href="#">退出登录</a></p>
</span>
</span>
</span>
|
</span>
<script>
$(function(){
$(".user").hover(function(){
$(this).find(".user-cs").show();
},function(){
$(this).find(".user-cs").hide();
});
});
</script>
-->
<span
class=
"topBar-userWelcome"
th:if=
"${session.sessionUser == null}"
>
您好,欢迎来商城!
<a
th:href=
"@{/portal/toLogin.do}"
id=
"loginHref"
rel=
"popbox"
>
[登录]
</a>
<a
id=
"registerHref"
th:href=
"@{/portal/toLogin.do}"
>
[注册]
</a></span>
<!--登录后 -->
<span
class=
"topBar-userWelcome logined"
th:if=
"${session.sessionUser != null}"
th:onshow=
"true"
>
欢迎您
<span
class=
"user"
>
<a
href=
"#"
class=
"user-link"
th:text=
"${session.sessionUser}"
><em
class=
"icon-arr"
></em></a>
<span
class=
"user-cs"
style=
"display:none;"
>
<span
class=
"user-cs-con"
>
<s
class=
"icon-arr"
></s>
<p><a
href=
"#"
>
个人中心
</a></p>
<p><a
href=
"#"
>
退出登录
</a></p>
</span>
</span>
</span>
</span>
<script>
$
(
function
(){
$
(
"
.user
"
).
hover
(
function
(){
$
(
this
).
find
(
"
.user-cs
"
).
show
();
},
function
(){
$
(
this
).
find
(
"
.user-cs
"
).
hide
();
});
});
</script>
<!--//welcome-->
<!--topBar-menu-->
<span
class=
"topBar-menu"
>
<a
href=
"#"
>
商户入驻申请
</a>
|
<a
href=
"#"
>
我的订单
</a>
|
<a
href=
"#"
>
网上营业厅
</a>
</span>
...
...
@@ -177,7 +178,7 @@
<!--headerNav-nav-->
<nav
class=
"headerNav-nav"
>
<ul
class=
"clearfix"
>
<li><a
href=
"#
"
class=
"selected"
>
首页
</a></li>
<li><a
th:href=
"@{/portal/toIndex.do}
"
class=
"selected"
>
首页
</a></li>
<li><a
href=
"#"
>
手机汇
</a></li>
<li><a
href=
"#"
>
聚优惠
</a></li>
<li><a
href=
"#"
>
商业街
</a></li>
...
...
@@ -333,92 +334,16 @@
</div>
<!--copyright-->
<div
class=
"footer-copyright"
>
<p
class=
"copyright"
>
版权所有 ©201
8
</p>
<p
class=
"copyright"
>
版权所有 ©201
7
</p>
<s
class=
"cr-icon"
></s>
</div>
<!--//copyright-->
</footer>
<!--//footer-->
<div
class=
"mark"
style=
"display:none;"
></div>
<!--登录弹框-->
<div
class=
"popbox tabs"
style=
"display:none;"
>
<div
class=
"pop-head"
>
<h2>
登录
<em
class=
"f-red1"
>
账号
</em></h2>
<a
href=
"javascript:;"
class=
"pop-close"
></a>
</div>
<ul
class=
"pop-login-cut cut clearfix"
>
<li
class=
"current"
>
注册用户登录
</li>
<li>
手机用户登录
</li>
</ul>
<div
class=
"pop-body"
>
<!--注册用户登录-->
<div
class=
"tab"
>
<div
class=
"pop-login-form"
>
<p>
<label
class=
"label"
><em
class=
"f-red1"
>
*
</em>
用 户 名:
</label>
<input
type=
"text"
size=
"35"
class=
"text-box"
/>
</p>
<p>
<label
class=
"label"
><em
class=
"f-red1"
>
*
</em>
登录密码:
</label>
<input
type=
"password"
size=
"20"
class=
"text-box"
/>
</p>
<p>
<label
class=
"label"
><em
class=
"f-red1"
>
*
</em>
验 证 码:
</label>
<input
type=
"text"
size=
"10"
class=
"text-box"
/>
<span
class=
"code-img"
><img
src=
"images/code_img.png"
/></span><a
href=
"#"
class=
"cg"
>
换一张
</a></p>
<p
class=
"sub-btn"
>
<label
class=
"label"
>
</label>
<input
type=
"submit"
value=
"登 录"
class=
"btn btn-red"
/>
</p>
</div>
<div
class=
"pop-login-extra"
>
您还不是商城会员?
<a
href=
"#"
>
立即注册
</a>
</div>
</div>
<!--//注册用户登录-->
<!--手机用户登录-->
<div
class=
"tab"
style=
"display:none;"
>
<div
class=
"pop-login-form"
>
<p>
<label
class=
"label"
><em
class=
"f-red1"
>
*
</em>
手机号码:
</label>
<input
type=
"text"
size=
"35"
class=
"text-box"
/>
</p>
<p
class=
"tyhz"
>
<label
class=
"label"
><em
class=
"f-red1"
>
*
</em>
密码类型:
</label>
<label>
<input
type=
"radio"
/>
动态密码
</label>
</p>
<p>
<label
class=
"label"
><em
class=
"f-red1"
>
*
</em>
动态密码:
</label>
<input
type=
"password"
size=
"20"
class=
"text-box"
/>
<a
href=
"#"
class=
"gt btn btn-coffee"
>
获取
</a></p>
<p>
<label
class=
"label"
><em
class=
"f-red1"
>
*
</em>
验 证 码:
</label>
<input
type=
"text"
size=
"10"
class=
"text-box"
/>
<span
class=
"code-img"
><img
src=
"images/code_img.png"
/></span><a
href=
"#"
class=
"cg"
>
换一张
</a></p>
<p
class=
"sub-btn"
>
<label
class=
"label"
>
</label>
<input
type=
"submit"
value=
"登 录"
class=
"btn btn-red"
/>
</p>
</div>
</div>
<!--//手机用户登录-->
</div>
</div>
<!--//登录弹框-->
<script>
//tabs
$
(
function
(){
$
(
"
.tabs .cut li
"
).
click
(
function
(){
var
td_index
=
$
(
"
.tabs .cut li
"
).
index
(
this
);
$
(
this
).
addClass
(
"
current
"
).
siblings
().
removeClass
(
"
current
"
);
$
(
"
.tabs .tab
"
).
eq
(
td_index
).
show
().
siblings
(
"
.tab
"
).
hide
();
});
});
/*弹框*/
$
(
function
(){
$
(
"
[rel='popbox']
"
).
click
(
function
(){
/*rel=popbox*/
popPosition
(
'
.popbox
'
);
});
});
</script>
</body>
</html>
src/taoshop-portal/src/main/resources/templates/login.html
0 → 100644
浏览文件 @
5350199f
<!DOCTYPE HTML>
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"utf-8"
/>
<title>
登录注册页
</title>
<link
th:href=
"@{/static/css/public.css}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
th:href=
"@{/static/css/reg-login.css}"
rel=
"stylesheet"
type=
"text/css"
/>
</head>
<body
class=
"login-reg-page"
>
<!--header-->
<header
class=
"header"
>
<!--headerMain-->
<div
class=
"headerMain layout clearfix"
>
<!--logo-->
<h1
class=
"siteLogo"
><a
href=
"#"
title=
"中国电信"
class=
"siteLogo-homepage"
></a><a
href=
"#"
title=
"翼猫商城"
class=
"siteLogo-mallpage"
></a></h1>
<!--//logo-->
</div>
<!--//headerMain-->
</header>
<!--//header-->
<!--container-->
<div
class=
"container"
>
<div
class=
"login-reg-section"
>
<div
class=
"login-reg-main"
>
<div
class=
"login-pic"
>
<a
href=
"#"
><img
th:src=
"@{/static/images/login-reg-pic.jpg}"
/></a>
</div>
<div
class=
"login"
>
<div
class=
"login-hd"
>
<ul
class=
"clearfix"
>
<li
class=
"current"
>
电信手机用户登录
</li>
<li>
注册用户登录
</li>
</ul>
</div>
<div
class=
"login-bd"
>
<p
class=
"login-tips"
>
请输入正确的密码!
</p>
<div
class=
"forms-box login-box login-box-phone"
style=
"display:-none;"
>
<p><label
class=
"label"
><b
class=
"required"
>
*
</b>
手机号码:
</label><input
type=
"text"
class=
"user-text user-name"
/></p>
<p><label
class=
"label"
><b
class=
"required"
>
*
</b>
密码类型:
</label><input
type=
"radio"
name=
"pwd-type"
class=
"pwd-input"
/><span
class=
"pwd-type"
>
动态密码
</span><input
type=
"radio"
name=
"pwd-type"
class=
"pwd-input"
/><span
class=
"pwd-type"
>
服务密码
</span></p>
<p
class=
"pwd-p"
><label
class=
"label"
><b
class=
"required"
>
*
</b>
动态密码:
</label><input
type=
"text"
class=
"user-text user-pwd"
/><a
class=
"brown-btn get-pwd"
href=
"#"
><span>
获取
</span></a></p>
<p
class=
"pwd-p"
style=
"display:none;"
><label
class=
"label"
><b
class=
"required"
>
*
</b>
服务密码:
</label><input
type=
"text"
class=
"user-text user-pwd"
/></p>
<p><label
class=
"label"
>
</label><input
type=
"button"
class=
"orange-btn enter-btn"
value=
"登 录"
/><a
href=
"#"
class=
"entry"
>
忘记登录密码?
</a></p>
</div>
<div
class=
"forms-box login-box login-box-reg"
style=
"display:none;"
>
<p><label
class=
"label"
><b
class=
"required"
>
*
</b>
用 户 名:
</label><input
type=
"text"
id=
"username"
class=
"user-text user-name"
/></p>
<p><label
class=
"label"
><b
class=
"required"
>
*
</b>
登录密码:
</label><input
type=
"text"
id=
"password"
class=
"user-text user-pwd"
/><a
class=
"brown-btn get-pwd"
href=
"#"
><span>
获取
</span></a></p>
<p><label
class=
"label"
><b
class=
"required"
>
*
</b>
验 证 码:
</label><input
type=
"text"
id=
"code"
class=
"user-text user-code"
/><img
src=
""
id=
"codeImg"
class=
"code-img"
/><span
class=
"smsCapt"
>
看不清?
</span><a
href=
"#"
onclick=
"javascript:changeCode();"
class=
"input-tips"
><span>
换一张
</span></a></p>
<p><label
class=
"label"
>
</label><input
type=
"button"
id=
"login"
class=
"orange-btn enter-btn"
onclick=
"javascript:loginCheck();"
value=
"登 录"
/><a
href=
"#"
class=
"entry"
>
忘记登录密码?
</a></p>
<p
class=
"reg-tips"
>
您还不是翼猫商城会员?
<a
class=
"reg-now"
href=
"register.html"
>
立即注册
</a>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!--//container-->
<!--footer-->
<footer
class=
"footer"
>
<!--copyright-->
<div
class=
"footer-copyright"
>
<p
class=
"footer-nav"
><a
href=
"#"
>
关于我们
</a>
|
<a
href=
"#"
>
网厅公告
</a>
|
<a
href=
"#"
>
网站使用帮助
</a>
|
<a
href=
"#"
>
网站导航
</a>
|
<a
href=
"#"
>
业务合作
</a>
|
<a
href=
"#"
>
友情链接
</a></p>
<p
class=
"copyright"
>
版权所有 ©2009 中国电信集团公司 [ 增值电信业务经营许可证 A2.B1.B2-20090001 ] ICP证号京ICP备 09031924号
</p>
<s
class=
"cr-icon"
></s>
</div>
<!--//copyright-->
</footer>
<!--//footer-->
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/html5.js}"
></script>
<!-- 引入JQuery提示库 start-->
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.tips.js}"
></script>
<!-- 引入JQuery提示库 end-->
<!-- 引入Cookie库 start-->
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.cookie.js}"
></script>
<!-- 引入Cookie库 end -->
<script
type=
"text/javascript"
>
$
(
function
(){
var
loginRegLi
=
$
(
"
.login-hd li
"
),
loginRegDiv
=
$
(
"
.login-bd .login-box
"
);
loginRegLi
.
bind
(
"
click
"
,
function
(){
var
i
=
loginRegLi
.
index
(
this
);
loginRegLi
.
removeClass
(
"
current
"
).
eq
(
i
).
addClass
(
"
current
"
);
loginRegDiv
.
hide
().
eq
(
i
).
show
();
})
var
pwdInput
=
$
(
"
.pwd-input
"
),
pwdP
=
$
(
"
.pwd-p
"
);
pwdInput
.
bind
(
"
click
"
,
function
(){
var
i
=
pwdInput
.
index
(
this
);
pwdP
.
hide
().
eq
(
i
).
show
();
})
changeCode
();
$
(
"
#codeImg
"
).
bind
(
"
click
"
,
changeCode
);
});
/**按回车键触发登录按钮事件**/
$
(
document
).
keyup
(
function
(
event
)
{
if
(
event
.
keyCode
==
13
)
{
$
(
"
#login
"
).
trigger
(
"
click
"
);
}
});
/**获取时间戳**/
function
genTimestamp
()
{
var
time
=
new
Date
();
return
time
.
getTime
();
}
/**刷新验证码的脚本处理**/
function
changeCode
()
{
$
(
"
#codeImg
"
).
attr
(
"
src
"
,
"
code/generate.do?t=
"
+
genTimestamp
());
}
/**客户端校验**/
function
checkValidity
()
{
if
(
$
(
"
#username
"
).
val
()
==
""
)
{
$
(
"
#username
"
).
tips
({
side
:
2
,
msg
:
'
用户名不得为空
'
,
bg
:
'
#AE81FF
'
,
time
:
3
});
$
(
"
#username
"
).
focus
();
return
false
;
}
if
(
$
(
"
#password
"
).
val
()
==
""
)
{
$
(
"
#password
"
).
tips
({
side
:
2
,
msg
:
'
密码不得为空
'
,
bg
:
'
#AE81FF
'
,
time
:
3
});
$
(
"
#password
"
).
focus
();
return
false
;
}
if
(
$
(
"
#code
"
).
val
()
==
""
)
{
$
(
"
#code
"
).
tips
({
side
:
1
,
msg
:
'
验证码不得为空
'
,
bg
:
'
#AE81FF
'
,
time
:
3
});
$
(
"
#code
"
).
focus
();
return
false
;
}
return
true
;
}
/**服务器校验**/
function
loginCheck
(){
if
(
checkValidity
()){
var
username
=
$
(
"
#username
"
).
val
();
var
password
=
$
(
"
#password
"
).
val
();
var
code
=
username
+
"
,
"
+
password
+
"
,
"
+
$
(
"
#code
"
).
val
();
$
.
ajax
({
type
:
"
POST
"
,
//请求方式为POST
url
:
'
loginCheck.do
'
,
//检验url
data
:
{
LOGINDATA
:
code
,
tm
:
new
Date
().
getTime
()},
//请求数据
dataType
:
'
json
'
,
//数据类型为JSON类型
cache
:
false
,
//关闭缓存
success
:
function
(
data
){
//响应成功
if
(
"
success
"
==
data
.
flag
){
$
(
"
#login
"
).
tips
({
side
:
1
,
msg
:
'
正在登录 , 请稍后 ...
'
,
bg
:
'
#68B500
'
,
time
:
10
});
window
.
location
.
href
=
"
toIndex.do
"
;
}
else
if
(
"
faild
"
==
data
.
flag
){
$
(
"
#username
"
).
tips
({
side
:
1
,
msg
:
"
用户名或密码有误
"
,
bg
:
'
#FF5080
'
,
time
:
15
});
$
(
"
#username
"
).
focus
();
}
else
if
(
"
codeError
"
==
data
.
flag
){
$
(
"
#code
"
).
tips
({
side
:
1
,
msg
:
"
验证码输入有误
"
,
bg
:
'
#FF5080
'
,
time
:
15
});
$
(
"
#code
"
).
focus
();
}
}
});
}
}
</script>
</body>
</html>
src/taoshop-provider-api/taoshop-provider-api-usc/pom.xml
浏览文件 @
5350199f
...
...
@@ -8,6 +8,7 @@
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<groupId>
com.muses.taoshop.provider-api
</groupId>
<artifactId>
taoshop-provider-api-usc
</artifactId>
...
...
src/taoshop-provider-api/taoshop-provider-api-usc/src/main/java/com/muses/taoshop/user/entity/User.java
0 → 100644
浏览文件 @
5350199f
package
com.muses.taoshop.user.entity
;
import
lombok.Data
;
/**
* <pre>
* 商城用户信息VO类
* </pre>
*
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2018.08.05 15:24 修改内容:
* </pre>
*/
@Data
public
class
User
{
/**
* 用户名
*/
private
String
username
;
/**
* 密码
*/
private
String
password
;
}
src/taoshop-provider-api/taoshop-provider-api-usc/src/main/java/com/muses/taoshop/user/service/IUserService.java
0 → 100644
浏览文件 @
5350199f
package
com.muses.taoshop.user.service
;
import
com.muses.taoshop.user.entity.User
;
public
interface
IUserService
{
/**
* 登录验证
* @param username
* @param password
*/
User
loginCheck
(
String
username
,
String
password
);
}
src/taoshop-provider/taoshop-provider-usc/pom.xml
浏览文件 @
5350199f
...
...
@@ -24,9 +24,42 @@
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<build>
<resources>
<resource>
<directory>
src/main/java
</directory>
<includes>
<include>
**/*.xml
</include>
</includes>
<filtering>
true
</filtering>
</resource>
</resources>
<plugins>
<!-- 设置源文件编译 -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.6.1
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<compilerVersion>
1.8
</compilerVersion>
<encoding>
UTF-8
</encoding>
<skipMain></skipMain>
</configuration>
</plugin>
<!-- 解决资源文件的编码问题 -->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-resources-plugin
</artifactId>
<version>
3.0.2
</version>
<configuration>
<encoding>
UTF-8
</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
src/taoshop-provider/taoshop-provider-usc/src/main/java/com/muses/taoshop/user/mapper/UserMapper.java
0 → 100644
浏览文件 @
5350199f
package
com.muses.taoshop.user.mapper
;
import
com.muses.taoshop.user.entity.User
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
UserMapper
{
User
loginCheck
(
@Param
(
"username"
)
String
username
,
@Param
(
"password"
)
String
password
);
}
src/taoshop-provider/taoshop-provider-usc/src/main/java/com/muses/taoshop/user/service/UserServiceImpl.java
0 → 100644
浏览文件 @
5350199f
package
com.muses.taoshop.user.service
;
import
com.muses.taoshop.user.entity.User
;
import
com.muses.taoshop.user.mapper.UserMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
UserServiceImpl
implements
IUserService
{
@Autowired
UserMapper
userMapper
;
/**
* 登录验证
*
* @param username
* @param password
*/
@Override
public
User
loginCheck
(
String
username
,
String
password
)
{
return
userMapper
.
loginCheck
(
username
,
password
);
}
}
src/taoshop-provider/taoshop-provider-usc/src/main/resources/mybatis/UserMapper.xml
0 → 100644
浏览文件 @
5350199f
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.muses.taoshop.user.mapper.UserMapper"
>
<select
id=
"loginCheck"
resultType=
"User"
parameterType=
"string"
>
SELECT
tu.username,
tu.password
FROM
tb_user tu
WHERE tu.username = #{username}
AND tu.password = #{password}
</select>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录