feat: 飞书登录支持多租户和用户工号管理

后端改动:
- FeishuService: 从飞书用户信息获取 tenant_key 和手机号
- FeishuService: 新增 user_sn 表工号分配机制
- FeishuService: 优先使用 enterprise_email,支持手机号
- AuthController: 飞书免登支持 company 参数

前端改动:
- FeishuAutoLogin: 支持多租户 company 参数
- login/index: 支持 redirect 参数和已登录检测
- QRCodeLogin: 支持多租户参数传递
- router: 新增路由守卫和参数处理
- api.ts: 优化飞书登录 API 调用

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-27 17:57:49 +08:00
parent b1895be50d
commit b1ca2c58b7
8 changed files with 241 additions and 41 deletions
+4 -1
View File
@@ -14,12 +14,15 @@ Route::group('/api/v1', function () {
Route::get('/auth/qrcode-login/status', [app\controller\AuthController::class, 'qrcodeLoginStatus']);
// 测试接口
Route::get('/test/notification', [app\controller\TestController::class, 'testNotification']);
Route::get('/test/notification', [app\controller\TestController::class, 'notification']);
})->middleware($apiMiddleware);
// 飞书登录回调(不在 /api/v1 下,供飞书重定向使用)
Route::get('/login/callback', [app\controller\AuthController::class, 'qrcodeLoginCallback'])->middleware($apiMiddleware);
// 飞书卡片回调(不需要认证,飞书服务器直接调用)
Route::post('/feishu/card/callback', [app\controller\FeishuCardController::class, 'callback']);
// 用户路由(需要认证)
Route::group('/api/v1/user', function () {
Route::get('/info', [app\controller\UserController::class, 'info']);