c909ebdf88
- Introduced `getPlatformAccountsByUserId` method in `DyVideoUser` model to fetch active platform accounts for a specified user. - Added new API route for accessing platform accounts under `v1/platform/accounts`, requiring user authentication.
28 lines
827 B
PHP
28 lines
827 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use think\facade\Route;
|
|
use app\api\controller\v1\Auth;
|
|
use app\api\controller\v1\Platform;
|
|
|
|
/**
|
|
* API 应用路由
|
|
*/
|
|
|
|
// v1 认证接口(公开)
|
|
Route::post('v1/auth/login', [Auth::class, 'login']);
|
|
Route::post('v1/auth/register', [Auth::class, 'register']);
|
|
Route::post('v1/auth/refresh', [Auth::class, 'refresh']);
|
|
|
|
// v1 认证接口(需登录)
|
|
Route::group('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('v1/platform', function () {
|
|
Route::get('accounts', [Platform::class, 'accounts']);
|
|
})->middleware(\app\api\middleware\Auth::class);
|