This commit is contained in:
wangjinlei
2022-04-06 18:02:49 +08:00
parent e34f87de36
commit c1885928ff
262 changed files with 18633 additions and 0 deletions

35
vendor/hg/apidoc/src/Service.php vendored Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace hg\apidoc;
use think\facade\Config;
use think\facade\Route;
class Service extends \think\Service
{
public function boot()
{
$this->registerRoutes(function (){
$route_prefix = 'apidoc';
$apidocConfig = Config::get("apidoc")?Config::get("apidoc"):Config::get("apidoc.");
$routes = function () {
$controller_namespace = '\hg\apidoc\Controller@';
Route::get('config' , $controller_namespace . 'getConfig');
Route::get('apiData' , $controller_namespace . 'getApidoc');
Route::get('mdDetail' , $controller_namespace . 'getMdDetail');
Route::post('verifyAuth' , $controller_namespace . 'verifyAuth');
Route::post('createCrud' , $controller_namespace . 'createCrud');
};
if (!empty($apidocConfig['allowCrossDomain'])){
Route::group($route_prefix, $routes)->allowCrossDomain();
}
Route::group($route_prefix, $routes);
});
}
}