diff --git a/application/admin/controller/InterfaceList.php b/application/admin/controller/InterfaceList.php index 8785614..d8a7dc4 100644 --- a/application/admin/controller/InterfaceList.php +++ b/application/admin/controller/InterfaceList.php @@ -73,7 +73,7 @@ class InterfaceList extends Base { */ public function add() { $postData = $this->request->post(); - if (!preg_match("/^[A-Za-z0-9\/]+$/", $postData['apiClass'])) { + if (!preg_match("/^[A-Za-z0-9_\/]+$/", $postData['apiClass'])) { return $this->buildFailed(ReturnCode::DB_SAVE_ERROR, '真实类名只允许填写字母,数字和/'); } @@ -114,7 +114,7 @@ class InterfaceList extends Base { */ public function edit() { $postData = $this->request->post(); - if (!preg_match("/^[A-Za-z0-9\/]+$/", $postData['apiClass'])) { + if (!preg_match("/^[A-Za-z0-9_\/]+$/", $postData['apiClass'])) { return $this->buildFailed(ReturnCode::DB_SAVE_ERROR, '真实类名只允许填写字母,数字和/'); } diff --git a/application/api/behavior/BuildResponse.php b/application/api/behavior/BuildResponse.php index 94b8345..2e2cc1f 100644 --- a/application/api/behavior/BuildResponse.php +++ b/application/api/behavior/BuildResponse.php @@ -23,6 +23,8 @@ class BuildResponse { * @throws \think\exception\DbException */ public function run($response) { + $header = config('apiAdmin.CROSS_DOMAIN'); + $response->header($header); $data = $response->getData(); $request = Request::instance(); $hash = $request->routeInfo(); diff --git a/application/wiki/view/index/detail.html b/application/wiki/view/index/detail.html index fa0ef69..5ab0c63 100644 --- a/application/wiki/view/index/detail.html +++ b/application/wiki/view/index/detail.html @@ -37,7 +37,7 @@