tp6引入路由文件(多路由文件)

  • Post author:
  • Post category:其他


从路由文件
include 'cong.php';
include 'hui.php';

app.php主路由文件
1fdec1463daa4879ad13e72348248bfe.png

25cd9bcf50ad4665b394a3e011a0092e.png

cong.php

<?php
use think\facade\Route;

//聪哥
Route::get('cong/think', function () {
    return 'cong';
});

Route::group( function () {
//路由


})->allowCrossDomain([
    'Access-Control-Allow-Origin'        => '*',
    'Access-Control-Allow-Headers'       =>'Origin, Content-Type, Cookie, X-CSRF-TOKEN, Accept, Authorization, X-XSRF-TOKEN',
    'Access-Control-Allow-Methods'       =>'GET, POST, PUT, DELETE',
    'Access-Control-Allow-Credentials'   => 'true'
])->middleware(\app\admin\middleware\commons::class);



版权声明:本文为qq_34631220原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。