From c1e65acc2ecbfefdd6fcbe39b227227bf539901b Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 23 Sep 2019 14:49:22 +0800 Subject: [PATCH] Update demo.php --- route/demo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/route/demo.php b/route/demo.php index 2376c0ce7..cb38b9e7d 100644 --- a/route/demo.php +++ b/route/demo.php @@ -13,10 +13,12 @@ // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin // +---------------------------------------------------------------------- +use think\facade\Request; use think\facade\Route; -/* 演示环境禁止操作路由绑定 */ -if (in_array(request()->rootDomain(), ['ctolog.com', 'thinkadmin.top'])) { +/* 演示环境禁止操作路由绑定 */ +$domain = Request::host(true); +if (in_array($domain, ['127.0.0.1', 'localhost']) or stripos($domain, 'thinkadmin.top') <> false) { Route::post('admin/user/pass', function () { return json(['code' => 0, 'info' => '演示环境禁止修改用户密码!']); });