e0733cf672
- Updated API routes to use a unified versioning scheme under `/api/v1/auth`. - Implemented new authentication controller for login, registration, and token management. - Removed legacy user and index controllers, along with associated models and validation files. - Updated documentation to reflect new API endpoints and usage. - Cleaned up unused service and middleware files to streamline the application structure.
22 lines
594 B
PHP
22 lines
594 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use think\facade\Route;
|
|
use app\api\controller\v1\Auth;
|
|
|
|
/**
|
|
* 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);
|