Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
liyeyun-user-web
Project
Project
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
cfld-backend
liyeyun-user-web
Commits
7970f0e4
Commit
7970f0e4
authored
Nov 29, 2023
by
zhouxudong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改 jwt过期时间
parent
58d4e68c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
SysUserInfoServiceImpl.java
...user/moudle/user/service/impl/SysUserInfoServiceImpl.java
+2
-2
JwtTokenUtil.java
src/main/java/com/lyy/user/util/jwt/JwtTokenUtil.java
+2
-2
No files found.
src/main/java/com/lyy/user/moudle/user/service/impl/SysUserInfoServiceImpl.java
View file @
7970f0e4
...
...
@@ -102,7 +102,7 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
throw
new
ServiceException
(
"当前用户密码输入错误"
);
}
String
token
=
JwtTokenUtil
.
createToken
(
sysUserInfo
,
null
);
RedisUtil
.
set
(
Constants
.
token
+
token
,
sysUserInfo
.
getUserId
(),
15
,
TimeUnit
.
DAY
S
);
RedisUtil
.
set
(
Constants
.
token
+
token
,
sysUserInfo
.
getUserId
(),
JwtTokenUtil
.
expireTime
,
TimeUnit
.
MILLISECOND
S
);
return
token
;
}
...
...
@@ -130,7 +130,7 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
throw
new
ServiceException
(
"验证码有误"
);
}
String
token
=
JwtTokenUtil
.
createToken
(
sysUserInfo
,
null
);
RedisUtil
.
set
(
Constants
.
token
+
token
,
sysUserInfo
.
getUserId
(),
15
,
TimeUnit
.
DAY
S
);
RedisUtil
.
set
(
Constants
.
token
+
token
,
sysUserInfo
.
getUserId
(),
JwtTokenUtil
.
expireTime
,
TimeUnit
.
MILLISECOND
S
);
return
token
;
}
/**
...
...
src/main/java/com/lyy/user/util/jwt/JwtTokenUtil.java
View file @
7970f0e4
...
...
@@ -25,8 +25,8 @@ import java.util.Map;
*/
@Slf4j
public
class
JwtTokenUtil
{
p
rivate
static
Long
expireTime
=
288
00000L
;
//15天
p
ublic
static
Long
expireTime
=
12960
00000L
;
/**
* 采用HS256算法生成token
...
...
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