Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_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
赵啸非
smart_gov_platform
Commits
afcdc30e
Commit
afcdc30e
authored
Oct 20, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加初始化数据库脚本
parent
d1ae3fb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
base-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
.../xhx/base/framework/interceptor/AuthTokenServiceImpl.java
+13
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
View file @
afcdc30e
...
@@ -8,6 +8,8 @@ import com.mortals.framework.service.IUser;
...
@@ -8,6 +8,8 @@ import com.mortals.framework.service.IUser;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
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.feign.user.IUserFeign
;
import
com.mortals.xhx.feign.user.IUserFeign
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Claims
;
import
io.jsonwebtoken.Jwts
;
import
io.jsonwebtoken.Jwts
;
...
@@ -18,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -18,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Base64
;
import
java.util.Base64
;
...
@@ -34,6 +37,10 @@ import java.util.Map;
...
@@ -34,6 +37,10 @@ import java.util.Map;
@Order
(
1
)
@Order
(
1
)
@Slf4j
@Slf4j
public
class
AuthTokenServiceImpl
implements
IAuthTokenService
{
public
class
AuthTokenServiceImpl
implements
IAuthTokenService
{
@Autowired
private
UserService
userService
;
// 令牌自定义标识
// 令牌自定义标识
@Value
(
"${token.header:Authorization}"
)
@Value
(
"${token.header:Authorization}"
)
private
String
header
;
private
String
header
;
...
@@ -95,6 +102,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
...
@@ -95,6 +102,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
if
(
StringUtils
.
isNotEmpty
(
userStr
))
{
if
(
StringUtils
.
isNotEmpty
(
userStr
))
{
UserEntity
userEntity
=
JSONObject
.
parseObject
(
userStr
,
UserEntity
.
class
);
UserEntity
userEntity
=
JSONObject
.
parseObject
(
userStr
,
UserEntity
.
class
);
userEntity
.
setToken
(
token
);
userEntity
.
setToken
(
token
);
UserEntity
temp
=
userService
.
selectOne
(
new
UserQuery
().
loginName
(
userEntity
.
getLoginName
()));
if
(!
ObjectUtils
.
isEmpty
(
temp
)){
userEntity
.
setId
(
temp
.
getId
());
}
return
userEntity
;
return
userEntity
;
}
}
}
catch
(
Exception
e
)
{
}
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