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
cde9b341
Commit
cde9b341
authored
Oct 10, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交配置校验
parent
9ff6fa97
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
base-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthUserInterceptor.java
...s/xhx/base/framework/interceptor/AuthUserInterceptor.java
+6
-2
base-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
...er/src/main/java/com/mortals/xhx/common/key/RedisKey.java
+1
-1
portal-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
...er/src/main/java/com/mortals/xhx/common/key/RedisKey.java
+2
-9
No files found.
base-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthUserInterceptor.java
View file @
cde9b341
...
@@ -8,12 +8,14 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -8,12 +8,14 @@ import com.alibaba.fastjson.JSONObject;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.service.IAuthTokenService
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.service.IUser
;
import
com.mortals.framework.util.AESUtil
;
import
com.mortals.framework.util.AESUtil
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.framework.utils.ServletUtils
;
import
com.mortals.framework.web.interceptor.BaseInterceptor
;
import
com.mortals.framework.web.interceptor.BaseInterceptor
;
import
com.mortals.xhx.base.framework.config.InterceptorConfig
;
import
com.mortals.xhx.base.framework.config.InterceptorConfig
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.key.RedisKey
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -44,6 +46,8 @@ public class AuthUserInterceptor extends BaseInterceptor {
...
@@ -44,6 +46,8 @@ public class AuthUserInterceptor extends BaseInterceptor {
private
InterceptorConfig
config
;
private
InterceptorConfig
config
;
@Autowired
@Autowired
private
IAuthTokenService
authTokenService
;
private
IAuthTokenService
authTokenService
;
@Autowired
private
ICacheService
cacheService
;
@Value
(
"${trustedReferer:''}"
)
@Value
(
"${trustedReferer:''}"
)
private
String
trustedReferer
;
private
String
trustedReferer
;
...
@@ -57,8 +61,8 @@ public class AuthUserInterceptor extends BaseInterceptor {
...
@@ -57,8 +61,8 @@ public class AuthUserInterceptor extends BaseInterceptor {
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
throws
Exception
{
//response.setContentType("application/json");
//response.setContentType("application/json");
//String referer = request.getHeader("Referer");
String
referer
=
request
.
getHeader
(
"Referer"
);
String
referer
=
cacheService
.
get
(
RedisKey
.
KEY_REFERERS_CACHE
);
if
(!
ObjectUtils
.
isEmpty
(
referer
))
{
if
(!
ObjectUtils
.
isEmpty
(
referer
))
{
//校验host即可
//校验host即可
URI
host
=
URLUtil
.
getHost
(
new
URL
(
referer
));
URI
host
=
URLUtil
.
getHost
(
new
URL
(
referer
));
...
...
base-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
View file @
cde9b341
...
@@ -42,6 +42,6 @@ public class RedisKey {
...
@@ -42,6 +42,6 @@ public class RedisKey {
/**
/**
* referers
* referers
*/
*/
public
static
final
String
KEY_REFERERS_CACHE
=
"referers
:
"
;
public
static
final
String
KEY_REFERERS_CACHE
=
"referers"
;
}
}
portal-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
View file @
cde9b341
...
@@ -5,20 +5,13 @@ package com.mortals.xhx.common.key;
...
@@ -5,20 +5,13 @@ package com.mortals.xhx.common.key;
*/
*/
public
class
RedisKey
{
public
class
RedisKey
{
/**
* 登录 cookies key
*/
public
static
final
String
KEY_MENU_CACHE
=
"iot:base:MenuCacheKey:"
;
public
static
final
String
KEY_USER_MENU_CACHE
=
"user:menu"
;
public
static
final
String
KEY_USER_MENU_CACHE
=
"user:menu"
;
public
static
final
String
KEY_BURY_POINT_CACHE
=
"bury:point"
;
public
static
final
String
KEY_BURY_POINT_CACHE
=
"bury:point"
;
/**
public
static
final
String
KEY_REFERERS_CACHE
=
"referers"
;
* referers
*/
public
static
final
String
KEY_REFERERS_CACHE
=
"referers:"
;
}
}
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