Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
b05a5399
Commit
b05a5399
authored
Nov 21, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持mode配置history(表示去掉地址栏的#)
parent
2c48aedd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
15 deletions
+38
-15
ruoyi-admin/src/main/resources/static/ruoyi/index.js
+7
-3
ruoyi-admin/src/main/resources/templates/index.html
+28
-11
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java
+1
-1
ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/session/SpringSessionValidationScheduler.java
+2
-0
No files found.
ruoyi-admin/src/main/resources/static/ruoyi/index.js
View file @
b05a5399
...
...
@@ -482,9 +482,13 @@ $(function() {
// 设置锚点
function
setIframeUrl
(
href
)
{
var
nowUrl
=
window
.
location
.
href
;
var
newUrl
=
nowUrl
.
substring
(
0
,
nowUrl
.
indexOf
(
"#"
));
window
.
location
.
href
=
newUrl
+
"#"
+
href
;
if
(
$
.
common
.
equals
(
"history"
,
mode
))
{
storage
.
set
(
'publicPath'
,
href
);
}
else
{
var
nowUrl
=
window
.
location
.
href
;
var
newUrl
=
nowUrl
.
substring
(
0
,
nowUrl
.
indexOf
(
"#"
));
window
.
location
.
href
=
newUrl
+
"#"
+
href
;
}
}
$
(
window
).
keydown
(
function
(
event
)
{
...
...
ruoyi-admin/src/main/resources/templates/index.html
View file @
b05a5399
...
...
@@ -175,7 +175,7 @@
</a>
</div>
<ul
class=
"nav navbar-top-links navbar-right welcome-message"
>
<li><a
title=
"视频教程"
href=
"http://doc.ruoyi.vip/ruoyi/document/spjc.html"
target=
"_blank"
><i
class=
"fa fa-video-camera"
></i>
视频教程
</a></li>
<li><a
title=
"视频教程"
href=
"http://doc.ruoyi.vip/ruoyi/document/spjc.html"
target=
"_blank"
><i
class=
"fa fa-video-camera"
></i>
视频教程
</a></li>
<li><a
title=
"开发文档"
href=
"http://doc.ruoyi.vip"
target=
"_blank"
><i
class=
"fa fa-question-circle"
></i>
开发文档
</a></li>
<li><a
title=
"全屏显示"
href=
"javascript:void(0)"
id=
"fullScreen"
><i
class=
"fa fa-arrows-alt"
></i>
全屏显示
</a></li>
<li
class=
"dropdown user-menu"
>
...
...
@@ -247,7 +247,15 @@
<script
th:src=
"@{/ajax/libs/fullscreen/jquery.fullscreen.js}"
></script>
<script
th:inline=
"javascript"
>
var
ctx
=
[[@{
/
}]];
// 皮肤缓存
var
skin
=
storage
.
get
(
"skin"
);
// history(表示去掉地址的#)否则地址以"#"形式展示
var
mode
=
"history"
;
// 历史访问路径缓存
var
historyPath
=
storage
.
get
(
"historyPath"
);
// 排除非左侧菜单链接
var
excludesUrl
=
[
"/system/user/profile"
];
// 本地主题优先,未设置取系统配置
if
(
$
.
common
.
isNotEmpty
(
skin
)){
$
(
"body"
).
addClass
(
skin
.
split
(
'|'
)[
0
]);
...
...
@@ -275,18 +283,27 @@ function switchSkin() {
})
}
// 排除非左侧菜单链接
var
excludesUrl
=
[
"/system/user/profile"
];
/** 刷新时访问路径页签 */
function
applyPath
(
url
)
{
$
(
'a[href$="'
+
decodeURI
(
url
)
+
'"]'
).
click
();
if
(
$
.
inArray
(
url
,
excludesUrl
)){
$
(
'a[href$="'
+
url
+
'"]'
).
parent
(
"li"
).
addClass
(
"selected"
).
parents
(
"li"
).
addClass
(
"active"
).
end
().
parents
(
"ul"
).
addClass
(
"in"
);
}
}
$
(
function
()
{
var
hash
=
location
.
hash
;
if
(
hash
!==
''
)
{
var
url
=
hash
.
substring
(
1
,
hash
.
length
);
$
(
'a[href$="'
+
decodeURI
(
url
)
+
'"]'
).
click
();
if
(
$
.
inArray
(
url
,
excludesUrl
)){
$
(
'a[href$="'
+
url
+
'"]'
).
parent
(
"li"
).
addClass
(
"selected"
).
parents
(
"li"
).
addClass
(
"active"
).
end
().
parents
(
"ul"
).
addClass
(
"in"
);
}
}
if
(
$
.
common
.
equals
(
"history"
,
mode
)
&&
window
.
performance
.
navigation
.
type
==
1
)
{
var
url
=
storage
.
get
(
'publicPath'
);
if
(
$
.
common
.
isNotEmpty
(
url
))
{
applyPath
(
url
);
}
}
else
{
var
hash
=
location
.
hash
;
if
(
$
.
common
.
isNotEmpty
(
hash
))
{
var
url
=
hash
.
substring
(
1
,
hash
.
length
);
applyPath
(
url
);
}
}
});
</script>
</body>
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java
View file @
b05a5399
...
...
@@ -199,7 +199,7 @@ public class ShiroConfig
* 安全管理器
*/
@Bean
public
SecurityManager
securityManager
(
UserRealm
userRealm
,
SpringSessionValidationScheduler
springSessionValidationScheduler
)
public
SecurityManager
securityManager
(
UserRealm
userRealm
)
{
DefaultWebSecurityManager
securityManager
=
new
DefaultWebSecurityManager
();
// 设置realm.
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/shiro/web/session/SpringSessionValidationScheduler.java
View file @
b05a5399
...
...
@@ -10,6 +10,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
com.ruoyi.common.utils.Threads
;
...
...
@@ -39,6 +40,7 @@ public class SpringSessionValidationScheduler implements SessionValidationSchedu
*/
@Autowired
@Qualifier
(
"sessionManager"
)
@Lazy
private
ValidatingSessionManager
sessionManager
;
// 相隔多久检查一次session的有效性,单位毫秒,默认就是10分钟
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment