Files
mini_tp/route/app.php
T
nepiedg 5a9d6090f3 feat(member): enhance product info processing and add new utility methods
- Updated `getProductInfo` method to return processed product information using `buildEffectiveProductInfo`.
- Introduced new private methods for building effective product info, resolving software account levels, and checking special TikTok account status.
- Refactored platform string handling with `appendPlatform` method to ensure unique and sorted platform entries.
- Updated platform name mappings in `PlatformService` for consistency with new naming conventions.
2026-04-02 10:43:25 +00:00

42 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
use think\facade\Route;
use app\api\controller\v1\Auth;
use app\api\controller\v1\Platform;
use app\api\controller\v1\PublishPlan;
/**
* 全局路由入口。
*
* 当前项目使用 ThinkPHP 8 的根级 `route/app.php` 自动加载机制。
* 之前把 API 路由写在 `app/api/route/app.php`,框架不会自动扫描该位置,
* 因此会导致 `api/v1/platform/accounts` 等接口返回 404。
*
* 这里统一把 API 路由注册到真正生效的位置。
*/
// v1 认证接口(公开)
Route::post('api/v1/auth/login', [Auth::class, 'login']);
Route::post('api/v1/auth/register', [Auth::class, 'register']);
Route::post('api/v1/auth/refresh', [Auth::class, 'refresh']);
// v1 认证接口(需登录)
Route::group('api/v1/auth', function () {
Route::get('me', [Auth::class, 'me']);
Route::post('logout', [Auth::class, 'logout']);
Route::post('password', [Auth::class, 'password']);
})->middleware(\app\api\middleware\Auth::class);
// v1 平台账号管理接口(需登录)
Route::group('api/v1/platform', function () {
Route::get('accounts', [Platform::class, 'accounts']);
})->middleware(\app\api\middleware\Auth::class);
// v1 发布计划接口(需登录)
Route::group('api/v1/publish-plan', function () {
Route::get('list', [PublishPlan::class, 'index']);
Route::post('start/:id', [PublishPlan::class, 'start']);
Route::post('stop/:id', [PublishPlan::class, 'stop']);
})->middleware(\app\api\middleware\Auth::class);