Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
23ef0eaf
authored
Mar 24, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增403
parent
6f317ae4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
app/Http/Middleware/CheckIp.php
config/field.php
app/Http/Middleware/CheckIp.php
View file @
23ef0eaf
...
...
@@ -30,6 +30,11 @@ class CheckIp
return
$next
(
$request
);
}
Log
::
warning
(
json_encode
(
$record
));
// 直接 403 禁止访问的国家(俄罗斯、伊朗)
if
(
in_array
(
$record
[
'country'
][
'iso_code'
],
config
(
'field.forbidden_ip_iso_code'
)))
{
abort
(
403
);
}
// 重定向到 /info 页面的国家
if
(
in_array
(
$record
[
'country'
][
'iso_code'
],
config
(
'field.disable_ip_iso_code'
)))
{
view
()
->
share
(
'is_disable_ip'
,
1
);
return
redirect
()
->
to
(
'/info'
);
...
...
config/field.php
View file @
23ef0eaf
...
...
@@ -21,13 +21,17 @@ return [
'Passives'
=>
'https://img.ichunt.com/images/cms/202009/15/2e95ec65caf11787fa13ac60f90bf2f2.png'
,
'Modules & Devices & Products'
=>
'https://img.ichunt.com/images/cms/202009/15/37b1c3bb9823c5303cc22962695d2e58.jpg'
,
],
// 直接返回 403 禁止访问的国家
'forbidden_ip_iso_code'
=>
[
'RU'
,
// 俄罗斯
'IR'
,
// 伊朗
],
// 重定向到 /info 页面的国家
'disable_ip_iso_code'
=>
[
'US'
,
'CA'
,
'GB'
,
'AU'
,
'RU'
,
'IR'
,
'UA'
,
'SY'
,
]
...
...
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