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
26cd45cd
Commit
26cd45cd
authored
Sep 15, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
59a872f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
index.php
api/index.php
+6
-16
No files found.
api/index.php
View file @
26cd45cd
...
@@ -10,28 +10,18 @@ defined('YII_DEBUG') or define('YII_DEBUG', false);
...
@@ -10,28 +10,18 @@ defined('YII_DEBUG') or define('YII_DEBUG', false);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
defined
(
'YII_ENV'
)
or
define
(
'YII_ENV'
,
'prod'
);
define
(
'WALLET_PROJECT_PATH'
,
'/data_wallet/token'
);
//定义框架代码的目录
define
(
'WALLET_PROJECT_PATH'
,
'/data_wallet/token'
);
//定义框架代码的目录
define
(
'WALLET_RUNTIME_PATH'
,
dirname
(
__DIR__
));
//定义程序运行的目录
define
(
'WALLET_RUNTIME_PATH'
,
dirname
(
__DIR__
));
//定义程序运行的目录
require_once
__DIR__
.
'/../common/helper/InitAppHelper.php'
;
if
(
isset
(
$_GET
[
'env'
])
&&
'test'
==
$_GET
[
'env'
])
{
$realip
=
InitAppHelper
::
getUserIp
();
require_once
__DIR__
.
'/../common/helper/Curl.php'
;
$ip_list
=
file_get_contents
(
'http://172.16.0.230:8080/wallet_interface_ip_limit.txt'
);
require_once
__DIR__
.
'/../common/helper/InitAppHelper.php'
;
$ip_arr
=
explode
(
"
\n
"
,
$ip_list
);
if
(
strpos
(
$_SERVER
[
'REQUEST_URI'
],
'black-list'
)
==
false
)
{
foreach
(
$ip_arr
as
$key
=>
$ip
)
{
$realip
=
InitAppHelper
::
getUserIp
();
$url
=
'http://127.0.0.1:8082/interface/validate/black-list'
;
Curl
::
prepare
(
$url
);
Curl
::
exec_get
();
$ip_list
=
Curl
::
get_response_assoc
();
if
(
isset
(
$ip_list
[
'data'
])
&&
count
(
$ip_list
>
0
))
{
foreach
(
$ip_list
[
'data'
]
as
$key
=>
$ip
)
{
if
(
$ip
==
$realip
)
{
if
(
$ip
==
$realip
)
{
$data
=
[
$data
=
[
'code'
=>
403
,
'code'
=>
403
,
'message'
=>
'请求次数过多!'
'message'
=>
'请求次数过多!'
];
];
echo
json_encode
(
$data
);
echo
json_encode
(
$data
);
exit
;
exit
;
}
}
}
}
}
}
}
...
...
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