Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
30ce6204
Commit
30ce6204
authored
May 09, 2017
by
Java-郭京峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitabc.xyqb.com/head_group/xyqb-user2
parents
dcc3753a
2c2f8255
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
7 deletions
+89
-7
InterceptorConfig.java
...java/cn/quantgroup/xyqb/config/web/InterceptorConfig.java
+6
-0
IPWhiteListInterceptor.java
.../quantgroup/xyqb/interceptors/IPWhiteListInterceptor.java
+55
-0
xyqb.properties
src/main/resources/config/dev/xyqb.properties
+28
-7
No files found.
src/main/java/cn/quantgroup/xyqb/config/web/InterceptorConfig.java
View file @
30ce6204
package
cn
.
quantgroup
.
xyqb
.
config
.
web
;
import
cn.quantgroup.xyqb.interceptors.ChannelIdInterceptor
;
import
cn.quantgroup.xyqb.interceptors.IPWhiteListInterceptor
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
...
...
@@ -11,7 +13,11 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@Configuration
public
class
InterceptorConfig
extends
WebMvcConfigurerAdapter
{
@Value
(
"${configserver.disable}"
)
private
Integer
isDebug
;
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
new
IPWhiteListInterceptor
(
isDebug
)).
addPathPatterns
(
"/innerapi/**"
);
registry
.
addInterceptor
(
new
ChannelIdInterceptor
()).
addPathPatterns
(
"/**"
);
}
...
...
src/main/java/cn/quantgroup/xyqb/interceptors/IPWhiteListInterceptor.java
0 → 100644
View file @
30ce6204
package
cn
.
quantgroup
.
xyqb
.
interceptors
;
import
cn.quantgroup.xyqb.util.IPUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.regex.Pattern
;
/**
* Created by Administrator on 2017/5/9.
*/
public
class
IPWhiteListInterceptor
implements
HandlerInterceptor
{
private
Integer
isDebug
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
IPWhiteListInterceptor
.
class
);
private
static
final
String
patternStr
=
"172.*"
;
private
static
final
Pattern
pattern
=
Pattern
.
compile
(
patternStr
);
public
IPWhiteListInterceptor
(
Integer
isDebug
)
{
this
.
isDebug
=
isDebug
;
}
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
if
(
isDebug
!=
0
)
return
true
;
String
remoteIP
=
IPUtil
.
getRemoteIP
(
request
);
if
(
StringUtils
.
isNoneBlank
(
remoteIP
)){
/*boolean isMatch = pattern.matcher(remoteIP).matches();
if(!isMatch){
LOGGER.info("非法IP尝试访问,ip:[{}]",remoteIP);
}
return isMatch;*/
LOGGER
.
info
(
"来源IP:[{}]"
,
remoteIP
);
}
// LOGGER.info("未能获取remoteIP");
return
true
;
}
@Override
public
void
postHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
ModelAndView
modelAndView
)
throws
Exception
{
}
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
}
}
src/main/resources/config/dev/xyqb.properties
View file @
30ce6204
configserver.disable
=
1
configserver.system
=
xyqb-user
xyqb.data.mysql.jdbc-url
=
jdbc:mysql://192.168.4.104:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8
xyqb.data.mysql.jdbc-url
=
jdbc:mysql://192.168.4.163:3306/xyqb_user?useUnicode=true&characterEncoding=UTF8
xyqb.data.mysql.password
=
qatest
xyqb.data.mysql.user
=
qa
xyqb.data.mysql.max-pool-size
=
20
# CORS
xyqb.filter.allowedOrigin
=
*
xyqb.filter.allowedHeaders
=
Origin, No-Cache, x-auth-token, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type,Authorization
xyqb.data.redis.defaultExpiration
=
3600
# redis
xyqb.redis.master.host
=
192.168.4.13
xyqb.redis.master.host
=
192.168.4.1
6
3
xyqb.redis.master.port
=
6379
xyqb.redis.master.name
=
xyqb.redis.sentinel1.host
=
...
...
@@ -18,45 +24,60 @@ xyqb.redis.sentinel2.host=
xyqb.redis.sentinel2.port
=
0
xyqb.redis.sentinel3.host
=
xyqb.redis.sentinel3.port
=
0
# 短信平台配置
sms.is.debug
=
1
# LKB client
lkb.client.url
=
http://192.168.192.
251
:8082/LKBClient/openapi
lkb.client.url
=
http://192.168.192.
163
:8082/LKBClient/openapi
lkb.client.user.register.app
=
/new/register/registerApp.json
lkb.client.user.register.58jr
=
/new/register/jr58/saveUserInfo.json
lkb.client.user.update
=
/new/register/updateUser.json
# LKB import
lkb.import.url
=
http://spider.quantgroup.cn
# LKB
lkb.url
=
http://192.168.192.251:8081/LKB
lkb.entrypoint.jr58
=
/jr58/arc_all.html
# xyqb
xyqb.url
=
http://192.168.192.206:8999
xyqb.api.url
=
http://192.168.192.206:9004
xyqb.url
=
http://192.168.192.163:8999
xyqb.api.url
=
http://192.168.192.163:9004
# JR58
jr58.sign.key
=
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKG/Y0J/c+JguU6cPdFHRC9eHrkgaZ9bpYpeQVujBpL+OkA8pAQTZ1XhoLZu/IH4Rv2kx85e8WVF7FxIFkgqJobjvai2XsD7QRYHGb6EEsqjROPndxnlpLeXmyp+WvbPhtRMoLyP3bZncaR1xsPkmW4ajXSUCa4+qlEfrEMskG79AgMBAAECgYAYmA5StSh8unJSxqULpkdy4F/RjGEjDv9by7sqYN6GCUv4KoBR8lVbFKSoOLYCWSsKND0BXyRbXsdyvK9Op8IVsKIbUnpen5V2cgNrVhlomy7E7RFSdoyFcRuWzck0NGtjJLPzi4qztiKprFH8yMf3tfD8aEKMo7pFpqetGfkezQJBANZTUTiGePRsiO7igin92jf9pWeSiI9OecQ/9hxwIlXXxQAwMUcvvyjoKfp6TRs3HlYugoiP/5VwTWRM/iTbf18CQQDBMtpKI5NtgrpfqbN2czP35S7VOnYO0QofEEuLj3oVCo2CxXfz0cViY/ng3BFk/oTykbMmS/TxCD5VHi17QRsjAkEAv9/3ZtN8ldZVAQhn35AUPOwnmIHnH+TxvnBEtVDubEuvYmvCsihcyxKOAmBbh3HhBua8leXUusS/hHwpSnX3oQJAc4eLTYZUpMnl1UrPjGd7jiO4i72310hduxGtezlDEc4LrUWUY3Lvi9SpGjO/GxuwOLWz4ZTOVkxNqeyv2eKm7QJAQHvgO0ciDFuFuhahFli7ktyZcn5CV8PPkQrbMXUFrMbX3AP61HPyH9EGCqBvsdyRYqPxFseDFY3yYveOWMPq0Q==
jr58.notify.userinfo
=
http://xfd.test.58v5.cn/customer/quantgroup_user_info
# 图形验证码
# 是否启用超级验证码 "__SUPERQG__", 用于测试环境自动化测试, 线上环境可忽略此参数
xyqb.auth.captcha.super.enable
=
1
#首参数校验
xyqb.fplock.limit.byhour
=
3
xyqb.fplock.limit.byday
=
5
#sdk
model.quantgroup.url
=
http://model.quantgroup.cn
xyqb.auth.url
=
http://192.168.192.206:9001
usersys.url
=
http://localhost:9001
xyqb-user.ui
=
http://192.168.100.36:7043
wechat.appid
=
wxcdf6077af8127559
wechat.secret
=
16eaec16084d0d9c52d4114f359cc72c
#motan protocol
protocol.name
=
motan
protocol.contentLength
=
1048576
protocol.isDefault
=
true
#motan registry center
registry.protocol
=
zookeeper
registry.address
=
192.168.4.164:2181
#motan basic
registry.address
=
172.16.1.63:2181,172.16.1.64:2181,172.16.1.65:2181
motan.port
=
8082
motan.user.group
=
userGroup
motan.user.module
=
user-motan-rpc
...
...
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