Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-api-report
Overview
Overview
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
雷紫添
xzxt-api-report
Commits
ef099b00
Commit
ef099b00
authored
Sep 03, 2019
by
雷紫添
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加ip授权
parent
2eb92ecc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
src/main/java/com/founder/common/IpADressLock.java
+3
-2
src/main/resources/application-dev.yml
+1
-0
No files found.
src/main/java/com/founder/common/IpADressLock.java
View file @
ef099b00
...
...
@@ -17,7 +17,8 @@ public class IpADressLock {
private
String
ftpserverip
;
@Value
(
value
=
"${ftpfilePath}"
)
private
String
ftpfilePath
;
@Value
(
value
=
"${ipaddress}"
)
private
String
ipaddress
;
public
boolean
getIpAddress
(
HttpServletRequest
request
)
{
String
ip
=
request
.
getHeader
(
"x-forwarded-for"
);
if
(
ip
==
null
||
ip
.
length
()
==
0
||
"unknown"
.
equalsIgnoreCase
(
ip
))
{
...
...
@@ -37,7 +38,7 @@ public class IpADressLock {
}
RestTemplate
restTemplate
=
new
RestTemplate
();
String
result
=
restTemplate
.
getForObject
(
"http://"
+
ftpserverip
+
ftpfilePath
+
"/GA_D_RSDDM
.js"
,
String
.
class
);
String
result
=
restTemplate
.
getForObject
(
"http://"
+
ftpserverip
+
ftpfilePath
+
ipaddress
+
"
.js"
,
String
.
class
);
List
<
IpADdress
>
resultList
=
JSONArray
.
parseArray
(
result
,
IpADdress
.
class
);
...
...
src/main/resources/application-dev.yml
View file @
ef099b00
...
...
@@ -23,6 +23,7 @@ ftppass: p@ssw0rd[123]
ftpbathPath
:
/home/ftpuser/www/neimeng/FZXZ
ftpfilePath
:
/neimeng/FZXZ
redistimeout
:
60000
ipaddress
:
/IP_ADDRESS
codemsg
:
status
:
-
code
:
"
10101"
...
...
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