公共登录 - 手机后、账号同时可作为登录条件

This commit is contained in:
柳清爽
2025-04-30 14:52:51 +08:00
parent f75c5fc310
commit df72ab8095
8 changed files with 275 additions and 186 deletions

View File

@@ -6,17 +6,17 @@ use think\facade\Route;
// 定义RESTful风格的API路由 - 认证相关
Route::group('v1/auth', function () {
// 无需认证的接口
Route::post('login', 'app\\common\\controller\\Auth@login'); // 账号密码登录
Route::post('mobile-login', 'app\\common\\controller\\Auth@mobileLogin'); // 手机号验证码登录
Route::post('code', 'app\\common\\controller\\Auth@sendCode'); // 发送验证码
Route::post('login', 'app\common\controller\PasswordLoginController@index'); // 账号密码登录
Route::post('mobile-login', 'app\common\controller\Auth@mobileLogin'); // 手机号验证码登录
Route::post('code', 'app\common\controller\Auth@SendCodeController'); // 发送验证码
// 需要JWT认证的接口
Route::get('info', 'app\\common\\controller\\Auth@info')->middleware(['jwt']); // 获取用户信息
Route::post('refresh', 'app\\common\\controller\\Auth@refresh')->middleware(['jwt']); // 刷新令牌
Route::get('info', 'app\common\controller\Auth@info')->middleware(['jwt']); // 获取用户信息
Route::post('refresh', 'app\common\controller\Auth@refresh')->middleware(['jwt']); // 刷新令牌
});
// 附件上传相关路由
Route::group('v1/', function () {
Route::post('attachment/upload', 'app\\common\\controller\\Attachment@upload'); // 上传附件
Route::get('attachment/:id', 'app\\common\\controller\\Attachment@info'); // 获取附件信息
Route::post('attachment/upload', 'app\common\controller\Attachment@upload'); // 上传附件
Route::get('attachment/:id', 'app\common\controller\Attachment@info'); // 获取附件信息
})->middleware(['jwt']);