fix: 使用飞书官方 passport 授权端点

后端修改:
- 授权 URL 从 open-apis 改为 passport.feishu.cn
- 使用 passport 端点获取 user_access_token
- 添加 httpGet 方法

前端修改:
- 使用官方 tt.requestAuthCode() API(飞书内免登)
- 保留轮询方式实现扫码登录

参考文档: https://open.feishu.cn/document/sso/web-application-sso/qr-sdk-documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-26 10:20:48 +08:00
parent fa8843d9e0
commit b1d58ece61
3 changed files with 55 additions and 11 deletions
+2 -2
View File
@@ -140,10 +140,10 @@ class AuthController extends BaseController
'expires_at' => date('Y-m-d H:i:s', time() + 300), // 5分钟过期
]);
// 构建扫码登录 URL
// 构建扫码登录 URL(使用官方 passport 端点)
$appId = 'cli_a8033d607cba500d';
$redirectUri = urlencode("https://xsm.dev.hnxinyouhe.com/login/qrcode/{$loginSession->id}");
$authUrl = "https://open.feishu.cn/open-apis/authen/v1/oidc/authorize?app_id={$appId}&redirect_uri={$redirectUri}&state={$loginSession->id}";
$authUrl = "https://passport.feishu.cn/suite/passport/oauth/authorize?client_id={$appId}&redirect_uri={$redirectUri}&response_type=code&state={$loginSession->id}";
// 生成二维码内容(返回 URL,前端生成二维码)
return $this->success([