// +---------------------------------------------------------------------- use app\api\middleware\BlockerMiddleware; use think\facade\Route; use think\facade\Config; use think\Response; Route::group(function () { Route::get('index/index', 'v1.index.IndexController/index')->option(['real_name' => '移动端首页']);//移动端首页 })->option(['mark' => 'index', 'mark_name' => '移动端接口']); Route::miss(function () { if (app()->request->isOptions()) { $header = Config::get('cookie.header'); unset($header['Access-Control-Allow-Credentials']); return Response::create('ok')->code(200)->header($header); } else return Response::create()->code(404); }); //未授权接口 Route::group(function () { Route::group(function () { //公共类 Route::get('site_config', 'v1.PublicController/getSiteConfig')->name('getSiteConfig')->option(['real_name' => '获取网站配置']);//获取网站配置 Route::get('sys_config', 'v1.PublicController/getSysConfig')->name('getSysConfig')->option(['real_name' => '通用根据配置分类获取配置']);//获取网站配置 })->option(['mark' => 'index', 'mark_name' => '主页接口']); Route::group(function () { Route::group(function () { //文章分类类 Route::get('article/category/list', 'v1.publics.ArticleCategoryController/lst')->name('articleCategoryList')->option(['real_name' => '文章分类列表']);//文章分类列表 //文章类 Route::get('article/list/:cid', 'v1.publics.ArticleController/lst')->name('articleList')->option(['real_name' => '文章列表']);//文章列表 Route::get('article/details/:id', 'v1.publics.ArticleController/details')->name('articleDetails')->option(['real_name' => '文章详情']);//文章详情 Route::get('article/hot/list', 'v1.publics.ArticleController/hot')->name('articleHotList')->option(['real_name' => '文章 热门']);//文章 热门 Route::get('article/new/list', 'v1.publics.ArticleController/new')->name('articleNewList')->option(['real_name' => '文章 最新']);//文章 最新 Route::get('article/banner/list', 'v1.publics.ArticleController/banner')->name('articleBannerList')->option(['real_name' => '文章 banner']);//文章 banner })->option(['parent' => 'activity_nologin', 'cate_name' => '文章(未授权)']); Route::group(function () { //案例分类类 Route::get('caseinfo/category/list', 'v1.publics.CaseCategoryController/lst')->name('caseCategoryController')->option(['real_name' => '案例分类列表']);//文章分类列表 //案例类 Route::get('caseinfo/list/:cid', 'v1.publics.CaseController/lst')->name('caseList')->option(['real_name' => '案例列表']);//文章列表 Route::get('caseinfo/details/:id', 'v1.publics.CaseController/details')->name('caseDetails')->option(['real_name' => '案例详情']);//文章详情 Route::get('caseinfo/hot/list', 'v1.publics.CaseController/hot')->name('caseHotList')->option(['real_name' => '案例 热门']);//文章 热门 Route::get('caseinfo/new/list', 'v1.publics.CaseController/new')->name('caseNewList')->option(['real_name' => '案例 最新']);//文章 最新 Route::get('caseinfo/banner/list', 'v1.publics.CaseController/banner')->name('caseBannerList')->option(['real_name' => '案例 banner']);//文章 banner Route::get('caseinfo/customer', 'v1.publics.CaseController/customer_witness')->name('caseCustomer')->option(['real_name' => '官网客户见证数据列表']);//文章分类列表 })->option(['parent' => 'caseinfo', 'cate_name' => '案例(未授权)']); Route::group(function () { //公司历程 Route::get('process/list', 'v1.publics.ProcessController/lst')->name('processList')->option(['real_name' => '公司历程列表']);//文章列表 })->option(['parent' => 'activity_nologin', 'cate_name' => '公司历程']); })->option(['mark' => 'web_site_info', 'mark_name' => '官网']); })->middleware(\app\http\middleware\AllowOriginMiddleware::class) ->middleware(\app\api\middleware\StationOpenMiddleware::class) ->middleware(\app\api\middleware\AuthTokenMiddleware::class, false);