feat: 适配透传invite_code

This commit is contained in:
tim
2025-08-17 21:56:14 +08:00
parent 9ca5d7b167
commit 923854bbc6

View File

@@ -69,7 +69,7 @@
</div> </div>
<div class="other-signup-page-content"> <div class="other-signup-page-content">
<div class="signup-page-button" @click="googleAuthorize"> <div class="signup-page-button" @click="signupWithGoogle">
<img class="signup-page-button-icon" src="~/assets/icons/google.svg" alt="Google Logo" /> <img class="signup-page-button-icon" src="~/assets/icons/google.svg" alt="Google Logo" />
<div class="signup-page-button-text">Google 注册</div> <div class="signup-page-button-text">Google 注册</div>
</div> </div>
@@ -111,9 +111,11 @@ const passwordError = ref('')
const code = ref('') const code = ref('')
const isWaitingForEmailSent = ref(false) const isWaitingForEmailSent = ref(false)
const isWaitingForEmailVerified = ref(false) const isWaitingForEmailVerified = ref(false)
const inviteToken = ref('')
onMounted(async () => { onMounted(async () => {
username.value = route.query.u || '' username.value = route.query.u || ''
inviteToken.value = route.query.invite_token || ''
try { try {
const res = await fetch(`${API_BASE_URL}/api/config`) const res = await fetch(`${API_BASE_URL}/api/config`)
if (res.ok) { if (res.ok) {
@@ -205,14 +207,17 @@ const verifyCode = async () => {
isWaitingForEmailVerified.value = false isWaitingForEmailVerified.value = false
} }
} }
const signupWithGoogle = () => {
googleAuthorize(inviteToken.value)
}
const signupWithGithub = () => { const signupWithGithub = () => {
githubAuthorize() githubAuthorize(inviteToken.value)
} }
const signupWithDiscord = () => { const signupWithDiscord = () => {
discordAuthorize() discordAuthorize(inviteToken.value)
} }
const signupWithTwitter = () => { const signupWithTwitter = () => {
twitterAuthorize() twitterAuthorize(inviteToken.value)
} }
</script> </script>