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
91986f13
Commit
91986f13
authored
Jul 04, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
国家信息安全漏洞(请务必保持cipherKey密钥唯一性)
parent
7728ad9e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
ruoyi-admin/src/main/resources/application.yml
+2
-0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java
+5
-1
No files found.
ruoyi-admin/src/main/resources/application.yml
View file @
91986f13
...
@@ -108,6 +108,8 @@ shiro:
...
@@ -108,6 +108,8 @@ shiro:
httpOnly
:
true
httpOnly
:
true
# 设置Cookie的过期时间,天为单位
# 设置Cookie的过期时间,天为单位
maxAge
:
30
maxAge
:
30
# 设置密钥,务必保持唯一性(生成方式,直接拷贝到main运行即可)KeyGenerator keygen = KeyGenerator.getInstance("AES"); SecretKey deskey = keygen.generateKey(); System.out.println(Base64.encodeToString(deskey.getEncoded()));
cipherKey
:
zSyK5Kp6PZAAjlT+eeNMlg==
session
:
session
:
# Session超时时间,-1代表永不过期(默认30分钟)
# Session超时时间,-1代表永不过期(默认30分钟)
expireTime
:
30
expireTime
:
30
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java
View file @
91986f13
...
@@ -85,6 +85,10 @@ public class ShiroConfig
...
@@ -85,6 +85,10 @@ public class ShiroConfig
@Value
(
"${shiro.cookie.maxAge}"
)
@Value
(
"${shiro.cookie.maxAge}"
)
private
int
maxAge
;
private
int
maxAge
;
// 设置cipherKey密钥
@Value
(
"${shiro.cookie.cipherKey}"
)
private
String
cipherKey
;
// 登录地址
// 登录地址
@Value
(
"${shiro.user.loginUrl}"
)
@Value
(
"${shiro.user.loginUrl}"
)
private
String
loginUrl
;
private
String
loginUrl
;
...
@@ -328,7 +332,7 @@ public class ShiroConfig
...
@@ -328,7 +332,7 @@ public class ShiroConfig
{
{
CookieRememberMeManager
cookieRememberMeManager
=
new
CookieRememberMeManager
();
CookieRememberMeManager
cookieRememberMeManager
=
new
CookieRememberMeManager
();
cookieRememberMeManager
.
setCookie
(
rememberMeCookie
());
cookieRememberMeManager
.
setCookie
(
rememberMeCookie
());
cookieRememberMeManager
.
setCipherKey
(
Base64
.
decode
(
"fCq+/xW488hMTCD+cmJ3aQ=="
));
cookieRememberMeManager
.
setCipherKey
(
Base64
.
decode
(
cipherKey
));
return
cookieRememberMeManager
;
return
cookieRememberMeManager
;
}
}
...
...
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