Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
smileNicky
taoshop
提交
0ab00ba8
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 搜索 >>
提交
0ab00ba8
编写于
10月 14, 2018
作者:
N
Nicky
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev'
上级
35a2722b
8233d2d3
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
58 addition
and
127 deletion
+58
-127
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/WebApplication.java
...c/main/java/com/muses/taoshop/manager/WebApplication.java
+1
-1
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/config/ShiroConfig.java
...in/java/com/muses/taoshop/manager/config/ShiroConfig.java
+7
-7
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/web/controller/CodeController.java
.../muses/taoshop/manager/web/controller/CodeController.java
+1
-1
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/web/controller/LoginController.java
...muses/taoshop/manager/web/controller/LoginController.java
+1
-81
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/admin/frame/common.html
...-web/src/main/resources/templates/admin/frame/common.html
+7
-7
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/admin/frame/nav.html
...ger-web/src/main/resources/templates/admin/frame/nav.html
+3
-3
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/admin/order/order_list.html
.../src/main/resources/templates/admin/order/order_list.html
+12
-12
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/admin/user/user_center.html
.../src/main/resources/templates/admin/user/user_center.html
+7
-7
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/login.html
...oshop-manager-web/src/main/resources/templates/login.html
+1
-1
src/taoshop-portal/src/main/java/com/muses/taoshop/base/SessionConsts.java
...l/src/main/java/com/muses/taoshop/base/SessionConsts.java
+8
-0
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/CodeController.java
...java/com/muses/taoshop/web/controller/CodeController.java
+3
-2
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/LoginController.java
...ava/com/muses/taoshop/web/controller/LoginController.java
+5
-3
src/taoshop-portal/src/main/resources/templates/header_main.html
...shop-portal/src/main/resources/templates/header_main.html
+2
-2
未找到文件。
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/WebApplication.java
浏览文件 @
0ab00ba8
...
...
@@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
@EnableTransactionManagement
//开启对事务管理配置的支持
@EnableCaching
@EnableAsync
//开启对异步方法的支持
@EnableAutoConfiguration
//TODO 修改该注解可以实现自动部署
@EnableAutoConfiguration
@SpringBootApplication
(
exclude
={
DataSourceAutoConfiguration
.
class
,
MybatisAutoConfiguration
.
class
,
DataSourceTransactionManagerAutoConfiguration
.
class
})
...
...
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/config/ShiroConfig.java
浏览文件 @
0ab00ba8
...
...
@@ -37,14 +37,14 @@ public class ShiroConfig {
filterChainDefinitionMap
.
put
(
"/upload/**"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/plugins/**"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/templates/**"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/code/generate"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/toLogin"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/loginCheck"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/code/
api/
generate"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/
login/api/
toLogin"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/admin/login
/api/login
Check"
,
"anon"
);
filterChainDefinitionMap
.
put
(
"/**"
,
"authc"
);
shiroFilterFactoryBean
.
setLoginUrl
(
"/admin/toLogin"
);
shiroFilterFactoryBean
.
setSuccessUrl
(
"/admin/toIndex"
);
shiroFilterFactoryBean
.
setUnauthorizedUrl
(
"/admin/toIndex"
);
shiroFilterFactoryBean
.
setLoginUrl
(
"/admin/
login/api/
toLogin"
);
shiroFilterFactoryBean
.
setSuccessUrl
(
"/admin/
login/api/
toIndex"
);
shiroFilterFactoryBean
.
setUnauthorizedUrl
(
"/admin/
login/api/
toIndex"
);
shiroFilterFactoryBean
.
setFilterChainDefinitionMap
(
filterChainDefinitionMap
);
return
shiroFilterFactoryBean
;
}
...
...
@@ -80,7 +80,7 @@ public class ShiroConfig {
//同一个用户最大的会话数,默认1;比如2的意思是同一个用户允许最多同时两个人登录;
filter
.
setMaxSession
(
1
);
//被踢出后重定向到的地址;
filter
.
setUrl
(
"/
l
ogin"
);
filter
.
setUrl
(
"/
admin/login/api/toL
ogin"
);
return
filter
;
}
...
...
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/web/controller/CodeController.java
浏览文件 @
0ab00ba8
...
...
@@ -20,7 +20,7 @@ import java.util.Random;
@Controller
@RequestMapping
(
"/
code
"
)
@RequestMapping
(
"/
admin/code/api
"
)
public
class
CodeController
{
@RequestMapping
(
"/generate"
)
...
...
src/taoshop-manager/taoshop-manager-web/src/main/java/com/muses/taoshop/manager/web/controller/LoginController.java
浏览文件 @
0ab00ba8
...
...
@@ -51,7 +51,7 @@ import java.util.List;
* </pre>
*/
@Controller
@RequestMapping
(
"/admin"
)
@RequestMapping
(
"/admin
/login/api
"
)
public
class
LoginController
extends
BaseController
{
@Autowired
...
...
@@ -176,86 +176,6 @@ public class LoginController extends BaseController {
}
@RequestMapping
(
"/code/generate"
)
public
void
generate
(
HttpServletResponse
response
){
ByteArrayOutputStream
output
=
new
ByteArrayOutputStream
();
String
code
=
drawImg
(
output
);
Subject
currentUser
=
SecurityUtils
.
getSubject
();
Session
session
=
currentUser
.
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-manager/taoshop-manager-web/src/main/resources/templates/admin/frame/common.html
浏览文件 @
0ab00ba8
...
...
@@ -4,12 +4,12 @@
<head
th:fragment=
"header"
>
<meta
charset=
"utf-8"
/>
<title>
电商运营平台
</title>
<link
th:href=
"@{
..
/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/static/css/backend.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/static/css/page/backend/account_center.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/plugins/datepicker/css/bootstrap.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/plugins/select2/css/select2.min.css}"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/common.js}"
></script>
<link
th:href=
"@{/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/backend.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/page/backend/account_center.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/plugins/datepicker/css/bootstrap.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/plugins/select2/css/select2.min.css}"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/common.js}"
></script>
</head>
</html>
\ No newline at end of file
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/admin/frame/nav.html
浏览文件 @
0ab00ba8
...
...
@@ -4,7 +4,7 @@
<div
class=
"navigation-inner"
>
<div
class=
"logo"
>
<h1>
<a
th:href=
"@{/admin/toIndex}"
class=
"logo-img"
>
电商运营平台
</a>
<a
th:href=
"@{/admin/
login/api/
toIndex}"
class=
"logo-img"
>
电商运营平台
</a>
</h1>
</div>
<div
class=
"header-categories"
id=
"nav-con"
>
...
...
@@ -37,7 +37,7 @@
</a>
</li>
<li>
<a
href=
"order.html
"
>
<a
th:href=
"@{/admin/order/api/toOrder}
"
>
<i
class=
"iconfont"
>

</i>
<span
class=
"pf-opt-name"
>
订单信息
</span>
</a>
...
...
@@ -55,7 +55,7 @@
</a>
</li>
<li
class=
"div-line"
>
<a
href=
"login.html
"
>
<a
th:href=
"@{/admin/login/api/toLogout}
"
>
<i
class=
"iconfont"
>

</i>
<span
class=
"pf-opt-name"
>
退出
</span>
</a>
...
...
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/admin/order/order_list.html
浏览文件 @
0ab00ba8
...
...
@@ -3,18 +3,18 @@
xmlns:th=
"http://www.thymeleaf.org"
>
<!-- 引入公共页面的一些样式和脚本-->
<head
>
<link
th:href=
"@{
..
/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/static/css/backend.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/static/css/page/backend/order_manage.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/plugins/datepicker/css/bootstrap.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/plugins/datepicker/css/bootstrap-datepicker.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/plugins/select2/css/select2.min.css}"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/common.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{
..
/plugins/datepicker/js/bootstrap-datepicker.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{
..
/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.min.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/jquery.pagination.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{
..
/plugins/select2/js/select2.min.js}"
></script>
<link
th:href=
"@{/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/backend.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/page/backend/order_manage.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/plugins/datepicker/css/bootstrap.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/plugins/datepicker/css/bootstrap-datepicker.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/plugins/select2/css/select2.min.css}"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/common.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/plugins/datepicker/js/bootstrap-datepicker.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.min.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.pagination.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/plugins/select2/js/select2.min.js}"
></script>
</head>
<body>
...
...
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/admin/user/user_center.html
浏览文件 @
0ab00ba8
...
...
@@ -3,13 +3,13 @@
xmlns:th=
"http://www.thymeleaf.org"
>
<!-- 引入公共页面的一些样式和脚本-->
<head>
<link
th:href=
"@{
..
/static/css/page/backend/account_center.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/static/css/backend.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/plugins/datepicker/css/bootstrap.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{
..
/plugins/select2/css/select2.min.css}"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{
..
/static/js/common.js}"
></script>
<link
th:href=
"@{/static/css/page/backend/account_center.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/style.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/static/css/backend.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/plugins/datepicker/css/bootstrap.css}"
rel=
"stylesheet"
/>
<link
th:href=
"@{/plugins/select2/css/select2.min.css}"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
th:src=
"@{/static/js/jquery.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/static/js/common.js}"
></script>
</head>
<body>
<!-- 顶部导航栏 -->
...
...
src/taoshop-manager/taoshop-manager-web/src/main/resources/templates/login.html
浏览文件 @
0ab00ba8
...
...
@@ -90,7 +90,7 @@
}
/**刷新验证码的脚本处理**/
function
changeCode
()
{
$
(
"
#codeImg
"
).
attr
(
"
src
"
,
"
code
/generate?t=
"
+
genTimestamp
());
$
(
"
#codeImg
"
).
attr
(
"
src
"
,
"
/admin/code/api
/generate?t=
"
+
genTimestamp
());
}
/**客户端校验**/
function
checkValidity
()
{
...
...
src/taoshop-portal/src/main/java/com/muses/taoshop/base/SessionConsts.java
浏览文件 @
0ab00ba8
...
...
@@ -13,5 +13,13 @@ package com.muses.taoshop.base;
* </pre>
*/
public
class
SessionConsts
{
/**
* 用户信息会话
*/
public
static
final
String
PORTAL_SESSION_USER
=
"potalSessionUser"
;
/**
* 验证码信息会话
*/
public
static
final
String
SESSION_SECURITY_CODE
=
"sessionSecurityCode"
;
}
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/CodeController.java
浏览文件 @
0ab00ba8
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
;
...
...
@@ -18,6 +17,8 @@ import java.io.ByteArrayOutputStream;
import
java.io.IOException
;
import
java.util.Random
;
import
static
com
.
muses
.
taoshop
.
base
.
SessionConsts
.
SESSION_SECURITY_CODE
;
@Controller
@RequestMapping
(
"/code"
)
...
...
@@ -31,7 +32,7 @@ public class CodeController {
// Subject currentUser = SecurityUtils.getSubject();
// Session session = currentUser.getSession();
HttpSession
session
=
request
.
getSession
();
session
.
setAttribute
(
Constants
.
SESSION_SECURITY_CODE
,
code
);
session
.
setAttribute
(
SESSION_SECURITY_CODE
,
code
);
try
{
ServletOutputStream
out
=
response
.
getOutputStream
();
...
...
src/taoshop-portal/src/main/java/com/muses/taoshop/web/controller/LoginController.java
浏览文件 @
0ab00ba8
package
com.muses.taoshop.web.controller
;
import
com.muses.taoshop.base.SessionConsts
;
import
com.muses.taoshop.user.entity.User
;
import
com.muses.taoshop.user.service.IUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -13,6 +12,9 @@ import javax.servlet.http.HttpSession;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
muses
.
taoshop
.
base
.
SessionConsts
.
PORTAL_SESSION_USER
;
import
static
com
.
muses
.
taoshop
.
base
.
SessionConsts
.
SESSION_SECURITY_CODE
;
/**
* <pre>
* 登录控制类
...
...
@@ -55,7 +57,7 @@ public class LoginController extends BaseController{
String
logindata
[]
=
request
.
getParameter
(
"LOGINDATA"
).
split
(
","
);
HttpSession
session
=
request
.
getSession
();
if
(
logindata
!=
null
&&
logindata
.
length
==
3
)
{
String
codeSession
=
(
String
)
session
.
getAttribute
(
S
essionConsts
.
PORTAL_SESSION_USER
);
String
codeSession
=
(
String
)
session
.
getAttribute
(
S
ESSION_SECURITY_CODE
);
String
username
=
logindata
[
0
];
String
password
=
logindata
[
1
];
String
code
=
logindata
[
2
];
...
...
@@ -65,7 +67,7 @@ public class LoginController extends BaseController{
//}else{ //账号密码校验
User
user
=
userService
.
loginCheck
(
username
,
password
);
if
(
user
!=
null
){
//校验成功
session
.
setAttribute
(
SessionConsts
.
PORTAL_SESSION_USER
,
username
);
session
.
setAttribute
(
PORTAL_SESSION_USER
,
username
);
flag
=
"success"
;
}
else
{
//账号或者密码错误
flag
=
"faild"
;
...
...
src/taoshop-portal/src/main/resources/templates/header_main.html
浏览文件 @
0ab00ba8
...
...
@@ -29,10 +29,10 @@
<dt>
<span
class=
"shop-amount"
>
0
</span>
<em
class=
"icon-cart"
></em>
<a
href=
"#"
>
去购物车结算
</a>
<span
class=
"angle"
></span>
</dt>
<dd
style=
"display:none;"
>
<!--购物车为空-->
<div
class=
"nogoods"
style=
"display:none;"
>
购物车中还没有商品,赶紧选购吧!
</div>
<div
class=
"nogoods"
th:if=
"${session.potalSessionUser == null}"
style=
"display:none;"
>
购物车中还没有商品,赶紧选购吧!
</div>
<!--//购物车为空-->
<!--有商品-->
<div
class=
"cart-table"
>
<div
class=
"cart-table"
th:if=
"${session.potalSessionUser != null}"
>
<div
class=
"cart-table-body"
>
<ul
class=
"cart-item clearfix"
>
<li
class=
"item-img"
><a
href=
"#"
><img
th:src=
"@{/static/picture/img_small_350x350.jpg}"
/></a></li>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录