api-doc
api-doc copied to clipboard
thinkphp5启用域名部署路由功能的配置做法
比如我在route.php中使用了域名路由 Route::domain('admin.thinkphp.cn','admin'); Route::domain('blog.thinkphp.cn','blog'); Route::domain('www.thinkphp.cn','www'); 这时我想生成www模块下api文档,就得注册路由 Route::get('doc/assets', "\Api\Doc\DocController@assets",['deny_ext'=>'php|.htacess','domain'=>'www'],[],'www'); Route::get('doc/list', "\Api\Doc\DocController@getList",['domain'=>'www'],[],'www'); Route::get('doc/info', "\Api\Doc\DocController@getInfo",['domain'=>'www'],[],'www'); Route::any('doc/debug', "\Api\Doc\DocController@debug",['domain'=>'www'],[],'www'); Route::get('doc', "\Api\Doc\DocController@index",['domain'=>'www'],[],'www'); 注意:Route::get('doc', "\Api\Doc\DocController@index",['domain'=>'www'],[],'www');这句一定要放到最后
这种情况 我当时还真没考虑 谢谢你的参考方法