Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fj-captcha-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
郑磊
fj-captcha-service
Commits
88445649
Commit
88445649
authored
Jan 09, 2026
by
郑磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加代理ip解析
parent
f002a0d9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
CaptchaController.java
...in/java/com/fanjiao/captcha/server/CaptchaController.java
+11
-0
No files found.
server/src/main/java/com/fanjiao/captcha/server/CaptchaController.java
View file @
88445649
...
@@ -37,6 +37,17 @@ public class CaptchaController {
...
@@ -37,6 +37,17 @@ public class CaptchaController {
)
{
)
{
var
type
=
getRandomType
();
var
type
=
getRandomType
();
var
ip
=
request
.
getRemoteAddr
();
var
ip
=
request
.
getRemoteAddr
();
var
proxyIp
=
request
.
getHeader
(
"x-forwarded-for"
);
if
(
proxyIp
!=
null
&&
!
proxyIp
.
isEmpty
())
{
ip
=
proxyIp
.
split
(
","
)[
0
].
trim
();
}
else
{
proxyIp
=
request
.
getHeader
(
"x-real-ip"
);
if
(
proxyIp
!=
null
&&
!
proxyIp
.
isEmpty
())
{
ip
=
proxyIp
;
}
}
Map
<
String
,
Object
>
extra
=
null
;
Map
<
String
,
Object
>
extra
=
null
;
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
extra
=
data
.
getExtra
();
extra
=
data
.
getExtra
();
...
...
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