修正邀請碼問題

This commit is contained in:
2025-09-19 03:12:45 +08:00
parent b5e8cce2f3
commit ea17bd0ca2
6 changed files with 65 additions and 9 deletions

View File

@@ -2336,7 +2336,8 @@ export function CompetitionManagement() {
})
}
const judgeScoringUrl = typeof window !== "undefined" ? `${window.location.origin}/judge-scoring` : "/judge-scoring"
const baseUrl = process.env.NEXT_PUBLIC_APP_URL || (typeof window !== "undefined" ? window.location.origin : 'http://localhost:3000')
const judgeScoringUrl = `${baseUrl}/judge-scoring`
// Filter out proposal competitions from display
const displayCompetitions = competitions.filter((competition) => competition.type !== "proposal")

View File

@@ -20,9 +20,8 @@ export function ScoringLinkDialog({ open, onOpenChange, currentCompetition }: Sc
const { toast } = useToast()
// 生成評分連結URL
const scoringUrl = typeof window !== 'undefined'
? `${window.location.origin}/judge-scoring`
: "https://preview-fork-of-ai-app-design-ieqe9ld0z64vdugqt.vusercontent.net/judge-scoring"
const baseUrl = process.env.NEXT_PUBLIC_APP_URL || (typeof window !== 'undefined' ? window.location.origin : 'http://localhost:3000')
const scoringUrl = `${baseUrl}/judge-scoring`
const accessCode = "judge2024"
const competitionName = currentCompetition?.name || "2024年第四季綜合AI競賽"

View File

@@ -457,9 +457,8 @@ export function UserManagement() {
const newToken = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)
const user = users.find((u) => u.id === userId)
const role = (user as any)?.invitedRole || "user"
const newInvitationLink = isClient
? `${window.location.origin}/register?token=${newToken}&email=${encodeURIComponent(email)}&role=${role}`
: `/register?token=${newToken}&email=${encodeURIComponent(email)}&role=${role}`
const baseUrl = process.env.NEXT_PUBLIC_APP_URL || (isClient ? window.location.origin : 'http://localhost:3000')
const newInvitationLink = `${baseUrl}/register?token=${newToken}&email=${encodeURIComponent(email)}&role=${role}`
setUsers(
users.map((user) =>