diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index 94d4179..9334d58 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -1107,3 +1107,7 @@ function getMarketLevel() return A("Market","Event")->getConfig('LevelConfig'); } +function isOutPaySite() { + return $_SERVER['HTTP_HOST'] == 'tg.jianghuifa.cn'; +} + diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index beb575a..f423d0c 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -44,8 +44,14 @@ class AdminController extends Controller { } } $rule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME); - if ($rule == 'admin/spend/listsmime') { - var_dump($_SERVER['HTTP_HOST']); + $outPayRules = [ + 'admin/spend/listsmime' + ]; + if (in_array($rule, $outPayRules) && !isOutPaySite()) { + die('地址错误'); + } + if (isOutPaySite() && !in_array($rule, $outPayRules)) { + redirect(U("admin/spend/listsmime")); } // 检测系统权限 if(!IS_ROOT){