From 9668106808bc15342488325c4a33d5cd522d71f4 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Sun, 30 Jun 2019 14:09:50 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E5=AE=8C=E5=96=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/InterfaceList.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/InterfaceList.php b/application/admin/controller/InterfaceList.php index 47a2124..6e331a4 100644 --- a/application/admin/controller/InterfaceList.php +++ b/application/admin/controller/InterfaceList.php @@ -12,7 +12,7 @@ use app\model\AdminApp; use app\model\AdminFields; use app\model\AdminList; use app\util\ReturnCode; -use app\util\Tools; +use think\facade\Env; class InterfaceList extends Base { /** @@ -176,14 +176,15 @@ class InterfaceList extends Base { * @author zhaoxiang */ public function refresh() { - $apiRoutePath = ROOT_PATH . 'application/apiRoute.php'; - $tplPath = ROOT_PATH . 'data/apiRoute.tpl'; + $rootPath = Env::get('root_path'); + $apiRoutePath = $rootPath . 'route/apiRoute.php'; + $tplPath = $rootPath . 'application/install/apiRoute.tpl'; $methodArr = ['*', 'POST', 'GET']; $tplStr = file_get_contents($tplPath); $listInfo = AdminList::all(['status' => 1]); foreach ($listInfo as $value) { - $tplStr .= 'Route::rule(\'api/' . addslashes($value->hash) . '\',\'api/' . addslashes($value->apiClass) . '\', \'' . $methodArr[$value->method] . '\', [\'after_behavior\' => $afterBehavior]);'; + $tplStr .= 'Route::rule(\'api/' . addslashes($value->hash) . '\',\'api/' . addslashes($value->api_class) . '\', \'' . $methodArr[$value->method] . '\', [\'after_behavior\' => $afterBehavior]);'; } file_put_contents($apiRoutePath, $tplStr);