【私域操盘手】账号密码登录

This commit is contained in:
eison
2025-03-16 17:43:30 +08:00
parent f4e36f1921
commit 1d7a87f29f
30 changed files with 1474 additions and 97 deletions

View File

@@ -0,0 +1,25 @@
<?php
// common模块路由配置
use think\facade\Route;
// 添加测试路由
Route::get('api/test', function() {
return json([
'code' => 200,
'msg' => '路由测试成功',
'data' => [
'time' => date('Y-m-d H:i:s'),
'module' => 'common'
]
]);
});
// 定义RESTful风格的API路由
Route::post('api/auth/login', 'app\\common\\controller\\Auth@login'); // 登录接口
// 需要JWT认证的接口
Route::get('api/auth/info', 'app\\common\\controller\\Auth@info')->middleware(['jwt']); // 获取用户信息
Route::post('api/auth/refresh', 'app\\common\\controller\\Auth@refresh')->middleware(['jwt']); // 刷新令牌
return [];