feat: 优化飞书免登失败后的用户体验
问题: - 移动端飞书 WebView 中 JSBridge SDK 未注入 - 导致免登功能不可用 修复: 1. debug-feishu.tsx - 多次检测环境,添加重试和重新检测功能 2. login/index.tsx - 支持 redirect 参数,登录成功后返回原页面 3. QRCodeLogin.tsx - 支持 redirect 参数 用户体验改进: - 免登失败时,友好提示用户使用其他登录方式 - 登录成功后自动返回到原页面(审批详情页) - 用户完成登录后可直接进行审批操作 替代方案: 1. 点击飞书消息中的"查看详情"按钮 2. 跳转到登录页面 3. 使用邮箱/密码或扫码登录 4. 登录成功后自动返回审批详情页 5. 直接进行审批操作 相关文件: - frontend/src/pages/debug-feishu.tsx - frontend/src/pages/login/index.tsx - frontend/src/pages/login/QRCodeLogin.tsx Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -234,9 +234,18 @@ export default function QRCodeLogin({ visible, onClose }: QRCodeLoginProps) {
|
||||
|
||||
Toast.show('登录成功')
|
||||
setTimeout(() => {
|
||||
console.log('🚀 Navigating to dashboard...')
|
||||
console.log('🚀 Navigating...')
|
||||
onClose()
|
||||
navigate('/dashboard')
|
||||
|
||||
// 检查是否有 redirect 参数
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const redirect = urlParams.get('redirect')
|
||||
if (redirect) {
|
||||
console.log('🔗 登录成功,跳转到:', redirect)
|
||||
window.location.href = redirect
|
||||
} else {
|
||||
navigate('/dashboard')
|
||||
}
|
||||
}, 500)
|
||||
} else if (result.data.status === 'scanning') {
|
||||
console.log('📱 Status: scanning')
|
||||
|
||||
Reference in New Issue
Block a user