From 1ccdbc0526cf24c65c5e07456b87de18e406656f Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 9 Mar 2026 08:01:42 -0700 Subject: [PATCH] feat(invite): show App download page after phone-invite registration Phone-invited users are mobile App users, not web admin users. After accepting a phone invitation, display App download QR + APK link instead of redirecting to /dashboard. Co-Authored-By: Claude Sonnet 4.6 --- .../src/app/(auth)/invite/[token]/page.tsx | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/it0-web-admin/src/app/(auth)/invite/[token]/page.tsx b/it0-web-admin/src/app/(auth)/invite/[token]/page.tsx index 7dab4c1..fe7c970 100644 --- a/it0-web-admin/src/app/(auth)/invite/[token]/page.tsx +++ b/it0-web-admin/src/app/(auth)/invite/[token]/page.tsx @@ -3,6 +3,7 @@ import { useState, useEffect } from 'react'; import { useRouter, useParams } from 'next/navigation'; import Link from 'next/link'; +import QRCode from 'react-qr-code'; import { useTranslation } from 'react-i18next'; import { apiClient } from '@/infrastructure/api/api-client'; @@ -36,6 +37,8 @@ export default function AcceptInvitePage() { const [confirmPassword, setConfirmPassword] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); const [submitError, setSubmitError] = useState(null); + const [registered, setRegistered] = useState(false); + const [downloadUrl, setDownloadUrl] = useState(null); useEffect(() => { async function validateInvite() { @@ -78,7 +81,17 @@ export default function AcceptInvitePage() { } } catch { /* ignore */ } - router.push('/dashboard'); + if (invite?.phone) { + // Phone invite = mobile App user, show App download page + const url = await fetch('/api/app/version/check?platform=android¤t_version_code=0') + .then((r) => r.json()) + .then((d) => d?.downloadUrl || null) + .catch(() => null); + setDownloadUrl(url); + setRegistered(true); + } else { + router.push('/dashboard'); + } } catch (err) { setSubmitError(err instanceof Error ? err.message : 'Failed to accept invitation'); } finally { @@ -109,6 +122,38 @@ export default function AcceptInvitePage() { ); } + if (registered) { + return ( +
+ iAgent +
+

注册成功!

+

+ 欢迎加入 {invite?.tenantName},请下载 App 开始使用 +

+
+ {downloadUrl ? ( +
+
+
+ +
+
+

扫码下载 Android App

+ + 直接下载 APK + +
+ ) : ( +

请向管理员获取 App 下载链接

+ )} +
+ ); + } + return (