api-doc icon indicating copy to clipboard operation
api-doc copied to clipboard

thinkphp5启用域名部署路由功能的配置做法

Open scalerone opened this issue 8 years ago • 1 comments

比如我在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');这句一定要放到最后

scalerone avatar Jun 13 '17 08:06 scalerone

这种情况 我当时还真没考虑 谢谢你的参考方法

zhangweiwei0326 avatar Jun 14 '17 09:06 zhangweiwei0326