Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
5e799947
Commit
5e799947
authored
Oct 20, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改上传文件大小限制
parent
199b1e4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
device-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
.../xhx/base/framework/interceptor/AuthTokenServiceImpl.java
+11
-1
No files found.
device-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
View file @
5e799947
...
...
@@ -8,6 +8,8 @@ import com.mortals.framework.service.IUser;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserQuery
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.code.PlatformTypeEnum
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Jwts
;
...
...
@@ -17,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Base64
;
...
...
@@ -58,6 +61,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
@Value
(
"${platform.type:cloud}"
)
private
String
platFormType
;
//版本,默认云服务版本
@Autowired
private
UserService
userService
;
protected
static
final
Long
SECOND
=
1
l
;
protected
static
final
Long
SECOND_MINUTE
=
60
*
SECOND
;
...
...
@@ -98,10 +104,14 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
}
else
{
userStr
=
cacheService
.
get
(
userKey
);
}
if
(
StringUtils
.
isNotEmpty
(
userStr
))
{
UserEntity
userEntity
=
JSONObject
.
parseObject
(
userStr
,
UserEntity
.
class
);
userEntity
.
setToken
(
token
);
//更新portal 中的id 为 device中的id
UserEntity
temp
=
userService
.
selectOne
(
new
UserQuery
().
loginName
(
userEntity
.
getLoginName
()));
if
(!
ObjectUtils
.
isEmpty
(
temp
)){
userEntity
.
setId
(
temp
.
getId
());
}
return
userEntity
;
}
}
catch
(
Exception
e
)
{
...
...
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