Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
smileNicky
jeeplatform
提交
5e5ddc74
J
jeeplatform
项目概览
smileNicky
/
jeeplatform
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
5
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jeeplatform
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
5
Issue
5
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5e5ddc74
编写于
5月 25, 2019
作者:
N
Nicky.Ma
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改Constant类命名
上级
7764519c
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
26 addition
and
26 deletion
+26
-26
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/core/CommonConsts.java
...rc/main/java/org/muses/jeeplatform/core/CommonConsts.java
+1
-1
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/util/DateUtils.java
...n/src/main/java/org/muses/jeeplatform/util/DateUtils.java
+2
-2
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/CodeController.java
.../org/muses/jeeplatform/web/controller/CodeController.java
+2
-2
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/LoginController.java
...org/muses/jeeplatform/web/controller/LoginController.java
+7
-7
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/MenuController.java
.../org/muses/jeeplatform/web/controller/MenuController.java
+3
-3
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/PermissionController.java
...uses/jeeplatform/web/controller/PermissionController.java
+2
-2
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/RoleController.java
.../org/muses/jeeplatform/web/controller/RoleController.java
+2
-2
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/UserController.java
.../org/muses/jeeplatform/web/controller/UserController.java
+3
-3
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/interceptor/LoginInterceptor.java
...g/muses/jeeplatform/web/interceptor/LoginInterceptor.java
+4
-4
未找到文件。
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/core/Co
nstan
ts.java
→
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/core/Co
mmonCons
ts.java
浏览文件 @
5e5ddc74
...
...
@@ -7,7 +7,7 @@ import java.util.Locale;
* @author Nicky
* @date 2017年3月6日
*/
public
class
Co
nstan
ts
{
public
class
Co
mmonCons
ts
{
//定义统一Locale.CHINA,程序中所有和Locale相关操作均默认使用此Locale
public
static
final
Locale
LOCALE_CHINA
=
Locale
.
CHINA
;
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/util/DateUtils.java
浏览文件 @
5e5ddc74
...
...
@@ -2,7 +2,7 @@ package org.muses.jeeplatform.util;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
...
...
@@ -40,7 +40,7 @@ public class DateUtils {
* @return
*/
public
static
Date
parse
(
String
pattern
,
String
date
){
return
parse
(
pattern
,
date
,
Co
nstan
ts
.
LOCALE_CHINA
);
return
parse
(
pattern
,
date
,
Co
mmonCons
ts
.
LOCALE_CHINA
);
}
/**
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/CodeController.java
浏览文件 @
5e5ddc74
...
...
@@ -3,7 +3,7 @@ package org.muses.jeeplatform.web.controller;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.session.Session
;
import
org.apache.shiro.subject.Subject
;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -30,7 +30,7 @@ public class CodeController {
Subject
currentUser
=
SecurityUtils
.
getSubject
();
Session
session
=
currentUser
.
getSession
();
session
.
setAttribute
(
Co
nstan
ts
.
SESSION_SECURITY_CODE
,
code
);
session
.
setAttribute
(
Co
mmonCons
ts
.
SESSION_SECURITY_CODE
,
code
);
try
{
ServletOutputStream
out
=
response
.
getOutputStream
();
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/LoginController.java
浏览文件 @
5e5ddc74
...
...
@@ -8,7 +8,7 @@ import org.apache.shiro.authc.UsernamePasswordToken;
import
org.apache.shiro.crypto.hash.SimpleHash
;
import
org.apache.shiro.session.Session
;
import
org.apache.shiro.subject.Subject
;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
org.muses.jeeplatform.core.ResultVO
;
import
org.muses.jeeplatform.core.entity.admin.Menu
;
import
org.muses.jeeplatform.core.entity.admin.Permission
;
...
...
@@ -95,7 +95,7 @@ public class LoginController extends BaseController {
//获取Shiro管理的Session
Subject
subject
=
SecurityUtils
.
getSubject
();
Session
session
=
subject
.
getSession
();
String
codeSession
=
(
String
)
session
.
getAttribute
(
Co
nstan
ts
.
SESSION_SECURITY_CODE
);
String
codeSession
=
(
String
)
session
.
getAttribute
(
Co
mmonCons
ts
.
SESSION_SECURITY_CODE
);
String
code
=
logindata
[
2
];
/**检测页面验证码是否为空,调用工具类检测**/
if
(
Tools
.
isEmpty
(
code
)){
...
...
@@ -116,9 +116,9 @@ public class LoginController extends BaseController {
}
else
{
//Shiro添加会话
session
.
setAttribute
(
"username"
,
username
);
session
.
setAttribute
(
Co
nstan
ts
.
SESSION_USER
,
user
);
session
.
setAttribute
(
Co
mmonCons
ts
.
SESSION_USER
,
user
);
//删除验证码Session
session
.
removeAttribute
(
Co
nstan
ts
.
SESSION_SECURITY_CODE
);
session
.
removeAttribute
(
Co
mmonCons
ts
.
SESSION_SECURITY_CODE
);
//保存登录IP
this
.
getRemortIP
(
username
);
/**Shiro加入身份验证**/
...
...
@@ -153,7 +153,7 @@ public class LoginController extends BaseController {
/**获取Shiro管理的Session**/
Subject
subject
=
SecurityUtils
.
getSubject
();
Session
session
=
subject
.
getSession
();
User
user
=
(
User
)
session
.
getAttribute
(
Co
nstan
ts
.
SESSION_USER
);
User
user
=
(
User
)
session
.
getAttribute
(
Co
mmonCons
ts
.
SESSION_USER
);
if
(
user
!=
null
){
Set
<
Role
>
roles
=
user
.
getRoles
();
...
...
@@ -218,8 +218,8 @@ public class LoginController extends BaseController {
/**Shiro管理Session**/
Subject
sub
=
SecurityUtils
.
getSubject
();
Session
session
=
sub
.
getSession
();
session
.
removeAttribute
(
Co
nstan
ts
.
SESSION_USER
);
session
.
removeAttribute
(
Co
nstan
ts
.
SESSION_SECURITY_CODE
);
session
.
removeAttribute
(
Co
mmonCons
ts
.
SESSION_USER
);
session
.
removeAttribute
(
Co
mmonCons
ts
.
SESSION_SECURITY_CODE
);
/**Shiro销毁登录**/
Subject
subject
=
SecurityUtils
.
getSubject
();
subject
.
logout
();
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/MenuController.java
浏览文件 @
5e5ddc74
...
...
@@ -2,7 +2,7 @@ package org.muses.jeeplatform.web.controller;
import
com.alibaba.fastjson.JSON
;
import
org.muses.jeeplatform.annotation.LogController
;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
org.muses.jeeplatform.core.entity.admin.Menu
;
import
org.muses.jeeplatform.core.entity.admin.Permission
;
import
org.muses.jeeplatform.service.MenuService
;
...
...
@@ -39,7 +39,7 @@ public class MenuController extends BaseController {
public
ModelAndView
toMenuList
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
throws
IOException
{
String
pageIndexStr
=
request
.
getParameter
(
"pageIndex"
);
int
pageSize
=
Co
nstan
ts
.
PAGE_SIZE
;
int
pageSize
=
Co
mmonCons
ts
.
PAGE_SIZE
;
ModelAndView
mv
=
this
.
getModelAndView
();
Page
<
Menu
>
menuPage
;
...
...
@@ -72,7 +72,7 @@ public class MenuController extends BaseController {
pageIndex
=
1
;
}
int
pageSize
=
Co
nstan
ts
.
PAGE_SIZE
;
int
pageSize
=
Co
mmonCons
ts
.
PAGE_SIZE
;
Page
<
Menu
>
menuPage
=
menuService
.
findAll
(
pageIndex
,
pageSize
,
Sort
.
Direction
.
ASC
,
"menuId"
);
String
json
=
JSON
.
toJSONString
(
menuPage
.
getContent
());
return
json
;
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/PermissionController.java
浏览文件 @
5e5ddc74
...
...
@@ -2,7 +2,7 @@ package org.muses.jeeplatform.web.controller;
import
com.alibaba.fastjson.JSON
;
import
org.muses.jeeplatform.annotation.LogController
;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
org.muses.jeeplatform.core.entity.admin.Permission
;
import
org.muses.jeeplatform.service.PermissionPageService
;
import
org.muses.jeeplatform.service.PermissionService
;
...
...
@@ -43,7 +43,7 @@ public class PermissionController extends BaseController {
public
ModelAndView
queryAll
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
){
String
pageIndexStr
=
request
.
getParameter
(
"pageIndex"
);
int
pageSize
=
Co
nstan
ts
.
PAGE_SIZE
;
int
pageSize
=
Co
mmonCons
ts
.
PAGE_SIZE
;
ModelAndView
mv
=
this
.
getModelAndView
();
Page
<
Permission
>
permissionPage
;
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/RoleController.java
浏览文件 @
5e5ddc74
...
...
@@ -2,7 +2,7 @@ package org.muses.jeeplatform.web.controller;
import
com.alibaba.fastjson.JSON
;
import
org.apache.commons.lang.StringUtils
;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
org.muses.jeeplatform.core.entity.admin.Menu
;
import
org.muses.jeeplatform.core.entity.admin.Permission
;
import
org.muses.jeeplatform.core.entity.admin.Role
;
...
...
@@ -51,7 +51,7 @@ public class RoleController extends BaseController {
public
ModelAndView
queryAll
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
){
String
pageIndexStr
=
request
.
getParameter
(
"pageIndex"
);
int
pageSize
=
Co
nstan
ts
.
PAGE_SIZE
;
int
pageSize
=
Co
mmonCons
ts
.
PAGE_SIZE
;
ModelAndView
mv
=
this
.
getModelAndView
();
Page
<
Role
>
rolePage
;
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/controller/UserController.java
浏览文件 @
5e5ddc74
...
...
@@ -2,7 +2,7 @@ package org.muses.jeeplatform.web.controller;
import
com.alibaba.fastjson.JSON
;
import
org.apache.shiro.crypto.hash.SimpleHash
;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
org.muses.jeeplatform.core.email.JavaEmailSender
;
import
org.muses.jeeplatform.core.entity.admin.Role
;
import
org.muses.jeeplatform.core.entity.admin.User
;
...
...
@@ -52,7 +52,7 @@ public class UserController extends BaseController {
public
ModelAndView
findAll
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
String
pageIndexStr
=
request
.
getParameter
(
"pageIndex"
);
int
pageSize
=
Co
nstan
ts
.
PAGE_SIZE
;
int
pageSize
=
Co
mmonCons
ts
.
PAGE_SIZE
;
ModelAndView
mv
=
this
.
getModelAndView
();
Page
<
User
>
userPage
;
...
...
@@ -90,7 +90,7 @@ public class UserController extends BaseController {
@RequestMapping
(
value
=
"/searchU"
,
produces
=
"application/json;charset=UTf-8"
)
public
ModelAndView
doSearch
(
@RequestParam
(
value
=
"pageIndex"
,
required
=
false
)
String
pageIndexStr
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"startDate"
,
required
=
false
)
String
startDateStr
,
@RequestParam
(
value
=
"endDate"
,
required
=
false
)
String
endDateStr
)
{
int
pageSize
=
Co
nstan
ts
.
PAGE_SIZE
;
int
pageSize
=
Co
mmonCons
ts
.
PAGE_SIZE
;
ModelAndView
mv
=
this
.
getModelAndView
();
Page
<
User
>
userPage
;
...
...
code/jeeplatform-admin/src/main/java/org/muses/jeeplatform/web/interceptor/LoginInterceptor.java
浏览文件 @
5e5ddc74
...
...
@@ -3,7 +3,7 @@ package org.muses.jeeplatform.web.interceptor;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.session.Session
;
import
org.apache.shiro.subject.Subject
;
import
org.muses.jeeplatform.core.Co
nstan
ts
;
import
org.muses.jeeplatform.core.Co
mmonCons
ts
;
import
org.muses.jeeplatform.core.entity.admin.User
;
import
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
;
...
...
@@ -22,19 +22,19 @@ public class LoginInterceptor extends HandlerInterceptorAdapter{
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
String
urlpath
=
request
.
getServletPath
();
/**正则表达式过滤,不匹配该值的就拦截处理**/
if
(
urlpath
.
matches
(
Co
nstan
ts
.
REGEXP_PATH
)){
if
(
urlpath
.
matches
(
Co
mmonCons
ts
.
REGEXP_PATH
)){
return
true
;
}
else
{
//shiro框架的会话管理,获取Session,校验用户是否通过登录验证
Subject
subject
=
SecurityUtils
.
getSubject
();
Session
session
=
subject
.
getSession
();
User
user
=
(
User
)
session
.
getAttribute
(
Co
nstan
ts
.
SESSION_USER
);
User
user
=
(
User
)
session
.
getAttribute
(
Co
mmonCons
ts
.
SESSION_USER
);
if
(
user
!=
null
){
/**加入权限校验,待开发...**/
return
true
;
}
else
{
//重定向到登录页面
response
.
sendRedirect
(
request
.
getContextPath
()
+
Co
nstan
ts
.
URL_LOGIN
);
response
.
sendRedirect
(
request
.
getContextPath
()
+
Co
mmonCons
ts
.
URL_LOGIN
);
return
false
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录