新增api应用模块

This commit is contained in:
2026-02-07 00:06:27 +08:00
parent badc502fbb
commit 0ed654b5b8
10 changed files with 500 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
use think\facade\Route;
/**
* 自动加载子路由文件
* 路由文件存放在 routes/ 目录下
*/
$routesPath = __DIR__ . '/routes';
// 检查路由目录是否存在
if (is_dir($routesPath)) {
// 获取所有 .php 文件
$routeFiles = glob($routesPath . '/*.php');
// 按名称排序,确保加载顺序
sort($routeFiles);
// 加载每个路由文件
foreach ($routeFiles as $file) {
require_once $file;
}
}