Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
ticker_config
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallets
ticker_config
Commits
bde03562
Commit
bde03562
authored
Feb 24, 2021
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
209ef2ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
index.php
api/index.php
+12
-12
No files found.
api/index.php
View file @
bde03562
...
...
@@ -12,18 +12,18 @@ define('WALLET_PROJECT_PATH', '/data_wallet/token'); //定义框架代码的目
define
(
'WALLET_RUNTIME_PATH'
,
dirname
(
__DIR__
));
//定义程序运行的目录
require_once
__DIR__
.
'/../common/helper/InitAppHelper.php'
;
$realip
=
InitAppHelper
::
getUserIp
();
$ip_list
=
file_get_contents
(
'http://172.16.0.230:8080/wallet_interface_ip_limit.txt'
);
$ip_arr
=
explode
(
"
\n
"
,
$ip_list
);
foreach
(
$ip_arr
as
$key
=>
$ip
)
{
if
(
$ip
==
$realip
)
{
$data
=
[
'code'
=>
403
,
'msg'
=>
'请求次数过多!'
];
echo
json_encode
(
$data
);
exit
;
}
}
//
$realip = InitAppHelper::getUserIp();
//
$ip_list = file_get_contents('http://172.16.0.230:8080/wallet_interface_ip_limit.txt');
//
$ip_arr = explode("\n", $ip_list);
//
foreach ($ip_arr as $key => $ip) {
//
if ($ip == $realip) {
//
$data = [
//
'code' => 403,
//
'msg' => '请求次数过多!'
//
];
//
echo json_encode($data);exit;
//
}
//
}
require
WALLET_PROJECT_PATH
.
'/vendor/autoload.php'
;
require
WALLET_PROJECT_PATH
.
'/vendor/yiisoft/yii2/Yii.php'
;
...
...
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