mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-08-19 01:31:00 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 215616d771 | |||
| 575e90e558 | |||
| e63d66806d | |||
| 1fc0118c5a | |||
| d67cc326c4 | |||
| 27c217a630 | |||
| 4e3e5f147c | |||
| 8767aa31d6 |
@@ -28,6 +28,7 @@ TWITTER_CLIENT_ID=<你的twitter-client-id>
|
|||||||
TWITTER_CLIENT_SECRET=<你的-twitter-client-secret>
|
TWITTER_CLIENT_SECRET=<你的-twitter-client-secret>
|
||||||
DISCORD_CLIENT_ID=<你的discord-client-id>
|
DISCORD_CLIENT_ID=<你的discord-client-id>
|
||||||
DISCORD_CLIENT_SECRET=<你的discord-client-secret>
|
DISCORD_CLIENT_SECRET=<你的discord-client-secret>
|
||||||
|
TELEGRAM_BOT_TOKEN=<你的telegram-bot-token>
|
||||||
|
|
||||||
# === OPENAI ===
|
# === OPENAI ===
|
||||||
OPENAI_API_KEY=<你的openai-api-key>
|
OPENAI_API_KEY=<你的openai-api-key>
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ NUXT_PUBLIC_GOOGLE_CLIENT_ID=777830451304-nt8afkkap18gui4f9entcha99unal744.apps.
|
|||||||
NUXT_PUBLIC_GITHUB_CLIENT_ID=Ov23liVkO1NPAX5JyWxJ
|
NUXT_PUBLIC_GITHUB_CLIENT_ID=Ov23liVkO1NPAX5JyWxJ
|
||||||
NUXT_PUBLIC_DISCORD_CLIENT_ID=1394985417044000779
|
NUXT_PUBLIC_DISCORD_CLIENT_ID=1394985417044000779
|
||||||
NUXT_PUBLIC_TWITTER_CLIENT_ID=ZTRTU05KSk9KTTJrTTdrVC1tc1E6MTpjaQ
|
NUXT_PUBLIC_TWITTER_CLIENT_ID=ZTRTU05KSk9KTTJrTTdrVC1tc1E6MTpjaQ
|
||||||
|
NUXT_PUBLIC_TELEGRAM_BOT_ID=8450237135
|
||||||
|
|||||||
@@ -14,3 +14,4 @@ NUXT_PUBLIC_GOOGLE_CLIENT_ID=777830451304-nt8afkkap18gui4f9entcha99unal744.apps.
|
|||||||
NUXT_PUBLIC_GITHUB_CLIENT_ID=Ov23liVkO1NPAX5JyWxJ
|
NUXT_PUBLIC_GITHUB_CLIENT_ID=Ov23liVkO1NPAX5JyWxJ
|
||||||
NUXT_PUBLIC_DISCORD_CLIENT_ID=1394985417044000779
|
NUXT_PUBLIC_DISCORD_CLIENT_ID=1394985417044000779
|
||||||
NUXT_PUBLIC_TWITTER_CLIENT_ID=ZTRTU05KSk9KTTJrTTdrVC1tc1E6MTpjaQ
|
NUXT_PUBLIC_TWITTER_CLIENT_ID=ZTRTU05KSk9KTTJrTTdrVC1tc1E6MTpjaQ
|
||||||
|
NUXT_PUBLIC_TELEGRAM_BOT_ID=8450237135
|
||||||
|
|||||||
@@ -0,0 +1,174 @@
|
|||||||
|
<template>
|
||||||
|
<div class="third-party-auth">
|
||||||
|
<div
|
||||||
|
v-for="provider in providers"
|
||||||
|
:key="provider.name"
|
||||||
|
class="third-party-button"
|
||||||
|
:class="provider.name"
|
||||||
|
@click="provider.action"
|
||||||
|
>
|
||||||
|
<img class="third-party-button-icon" :src="provider.icon" :alt="provider.alt" />
|
||||||
|
<div class="third-party-button-text">
|
||||||
|
{{ provider.label }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import googleIcon from '~/assets/icons/google.svg'
|
||||||
|
import githubIcon from '~/assets/icons/github.svg'
|
||||||
|
import discordIcon from '~/assets/icons/discord.svg'
|
||||||
|
import twitterIcon from '~/assets/icons/twitter.svg'
|
||||||
|
import telegramIcon from '~/assets/icons/telegram.svg'
|
||||||
|
|
||||||
|
import { googleAuthorize } from '~/utils/google'
|
||||||
|
import { githubAuthorize } from '~/utils/github'
|
||||||
|
import { discordAuthorize } from '~/utils/discord'
|
||||||
|
import { twitterAuthorize } from '~/utils/twitter'
|
||||||
|
import { telegramAuthorize } from '~/utils/telegram'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
mode: {
|
||||||
|
type: String,
|
||||||
|
default: 'login',
|
||||||
|
},
|
||||||
|
inviteToken: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const actionText = computed(() => (props.mode === 'signup' ? '注册' : '登录'))
|
||||||
|
|
||||||
|
const providers = computed(() => [
|
||||||
|
{
|
||||||
|
name: 'google',
|
||||||
|
icon: googleIcon,
|
||||||
|
action: () => googleAuthorize(props.inviteToken),
|
||||||
|
alt: 'Google Logo',
|
||||||
|
label: `Google ${actionText.value}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'github',
|
||||||
|
icon: githubIcon,
|
||||||
|
action: () => githubAuthorize(props.inviteToken),
|
||||||
|
alt: 'GitHub Logo',
|
||||||
|
label: `GitHub ${actionText.value}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'discord',
|
||||||
|
icon: discordIcon,
|
||||||
|
action: () => discordAuthorize(props.inviteToken),
|
||||||
|
alt: 'Discord Logo',
|
||||||
|
label: `Discord ${actionText.value}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'twitter',
|
||||||
|
icon: twitterIcon,
|
||||||
|
action: () => twitterAuthorize(props.inviteToken),
|
||||||
|
alt: 'Twitter Logo',
|
||||||
|
label: `Twitter ${actionText.value}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'telegram',
|
||||||
|
icon: telegramIcon,
|
||||||
|
action: () => telegramAuthorize(props.inviteToken),
|
||||||
|
alt: 'Telegram Logo',
|
||||||
|
label: `Telegram ${actionText.value}`,
|
||||||
|
},
|
||||||
|
])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.third-party-auth {
|
||||||
|
margin-left: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 30%;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 10px 20px;
|
||||||
|
min-width: 150px;
|
||||||
|
background-color: var(--login-background-color);
|
||||||
|
border: 1px solid var(--normal-border-color);
|
||||||
|
border-radius: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button:hover {
|
||||||
|
background-color: var(--login-background-color-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button-icon {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button-text {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provider specific classes for customization */
|
||||||
|
.third-party-button.google {
|
||||||
|
background-color: var(--google-bg, var(--login-background-color));
|
||||||
|
color: var(--google-color, inherit);
|
||||||
|
}
|
||||||
|
.third-party-button.google:hover {
|
||||||
|
background-color: var(--google-bg-hover, var(--login-background-color-hover));
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button.github {
|
||||||
|
background-color: var(--github-bg, var(--login-background-color));
|
||||||
|
color: var(--github-color, inherit);
|
||||||
|
}
|
||||||
|
.third-party-button.github:hover {
|
||||||
|
background-color: var(--github-bg-hover, var(--login-background-color-hover));
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button.discord {
|
||||||
|
background-color: var(--discord-bg, var(--login-background-color));
|
||||||
|
color: var(--discord-color, inherit);
|
||||||
|
}
|
||||||
|
.third-party-button.discord:hover {
|
||||||
|
background-color: var(--discord-bg-hover, var(--login-background-color-hover));
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button.twitter {
|
||||||
|
background-color: var(--twitter-bg, var(--login-background-color));
|
||||||
|
color: var(--twitter-color, inherit);
|
||||||
|
}
|
||||||
|
.third-party-button.twitter:hover {
|
||||||
|
background-color: var(--twitter-bg-hover, var(--login-background-color-hover));
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button.telegram {
|
||||||
|
background-color: var(--telegram-bg, var(--login-background-color));
|
||||||
|
color: var(--telegram-color, inherit);
|
||||||
|
}
|
||||||
|
.third-party-button.telegram:hover {
|
||||||
|
background-color: var(--telegram-bg-hover, var(--login-background-color-hover));
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.third-party-auth {
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 0px;
|
||||||
|
width: calc(100% - 40px);
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.third-party-button {
|
||||||
|
width: calc(100% - 40px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -34,44 +34,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="other-login-page-content">
|
<ThirdPartyAuth mode="login" />
|
||||||
<div class="login-page-button" @click="loginWithGoogle">
|
|
||||||
<img class="login-page-button-icon" src="../assets/icons/google.svg" alt="Google Logo" />
|
|
||||||
<div class="login-page-button-text">Google 登录</div>
|
|
||||||
</div>
|
|
||||||
<div class="login-page-button" @click="loginWithGithub">
|
|
||||||
<img class="login-page-button-icon" src="../assets/icons/github.svg" alt="GitHub Logo" />
|
|
||||||
<div class="login-page-button-text">GitHub 登录</div>
|
|
||||||
</div>
|
|
||||||
<div class="login-page-button" @click="loginWithDiscord">
|
|
||||||
<img class="login-page-button-icon" src="../assets/icons/discord.svg" alt="Discord Logo" />
|
|
||||||
<div class="login-page-button-text">Discord 登录</div>
|
|
||||||
</div>
|
|
||||||
<div class="login-page-button" @click="loginWithTwitter">
|
|
||||||
<img class="login-page-button-icon" src="../assets/icons/twitter.svg" alt="Twitter Logo" />
|
|
||||||
<div class="login-page-button-text">Twitter 登录</div>
|
|
||||||
</div>
|
|
||||||
<div class="login-page-button" @click="loginWithTelegram">
|
|
||||||
<img
|
|
||||||
class="login-page-button-icon"
|
|
||||||
src="../assets/icons/telegram.svg"
|
|
||||||
alt="Telegram Logo"
|
|
||||||
/>
|
|
||||||
<div class="login-page-button-text">Telegram 登录</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { toast } from '~/main'
|
import { toast } from '~/main'
|
||||||
import { setToken, loadCurrentUser } from '~/utils/auth'
|
import { setToken, loadCurrentUser } from '~/utils/auth'
|
||||||
import { googleAuthorize } from '~/utils/google'
|
|
||||||
import { githubAuthorize } from '~/utils/github'
|
|
||||||
import { discordAuthorize } from '~/utils/discord'
|
|
||||||
import { twitterAuthorize } from '~/utils/twitter'
|
|
||||||
import { telegramAuthorize } from '~/utils/telegram'
|
|
||||||
import BaseInput from '~/components/BaseInput.vue'
|
import BaseInput from '~/components/BaseInput.vue'
|
||||||
|
import ThirdPartyAuth from '~/components/ThirdPartyAuth.vue'
|
||||||
import { registerPush } from '~/utils/push'
|
import { registerPush } from '~/utils/push'
|
||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
const API_BASE_URL = config.public.apiBaseUrl
|
const API_BASE_URL = config.public.apiBaseUrl
|
||||||
@@ -114,22 +85,6 @@ const submitLogin = async () => {
|
|||||||
isWaitingForLogin.value = false
|
isWaitingForLogin.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loginWithGoogle = () => {
|
|
||||||
googleAuthorize()
|
|
||||||
}
|
|
||||||
const loginWithGithub = () => {
|
|
||||||
githubAuthorize()
|
|
||||||
}
|
|
||||||
const loginWithDiscord = () => {
|
|
||||||
discordAuthorize()
|
|
||||||
}
|
|
||||||
const loginWithTwitter = () => {
|
|
||||||
twitterAuthorize()
|
|
||||||
}
|
|
||||||
const loginWithTelegram = () => {
|
|
||||||
telegramAuthorize()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -202,16 +157,6 @@ const loginWithTelegram = () => {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.other-login-page-content {
|
|
||||||
margin-left: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 30%;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-page-button-primary {
|
.login-page-button-primary {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -241,29 +186,6 @@ const loginWithTelegram = () => {
|
|||||||
background-color: var(--primary-color-disabled);
|
background-color: var(--primary-color-disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-page-button {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 10px 20px;
|
|
||||||
min-width: 150px;
|
|
||||||
background-color: var(--login-background-color);
|
|
||||||
border: 1px solid var(--normal-border-color);
|
|
||||||
border-radius: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-page-button:hover {
|
|
||||||
background-color: var(--login-background-color-hover);
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-page-button-icon {
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-page-button-text {
|
.login-page-button-text {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
@@ -305,16 +227,5 @@ const loginWithTelegram = () => {
|
|||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.other-login-page-content {
|
|
||||||
margin-top: 20px;
|
|
||||||
margin-left: 0px;
|
|
||||||
width: calc(100% - 40px);
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-page-button {
|
|
||||||
width: calc(100% - 40px);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -334,6 +334,9 @@ onMounted(async () => {
|
|||||||
if (currentUser.value) {
|
if (currentUser.value) {
|
||||||
await fetchMessages(0)
|
await fetchMessages(0)
|
||||||
await markConversationAsRead()
|
await markConversationAsRead()
|
||||||
|
await nextTick()
|
||||||
|
// 初次进入频道时,平滑滚动到底部
|
||||||
|
scrollToBottomSmooth()
|
||||||
const token = getToken()
|
const token = getToken()
|
||||||
if (token && !isConnected.value) {
|
if (token && !isConnected.value) {
|
||||||
connect(token)
|
connect(token)
|
||||||
|
|||||||
@@ -68,44 +68,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="other-signup-page-content">
|
<ThirdPartyAuth mode="signup" :invite-token="inviteToken" />
|
||||||
<div class="signup-page-button" @click="signupWithGoogle">
|
|
||||||
<img class="signup-page-button-icon" src="~/assets/icons/google.svg" alt="Google Logo" />
|
|
||||||
<div class="signup-page-button-text">Google 注册</div>
|
|
||||||
</div>
|
|
||||||
<div class="signup-page-button" @click="signupWithGithub">
|
|
||||||
<img class="signup-page-button-icon" src="~/assets/icons/github.svg" alt="GitHub Logo" />
|
|
||||||
<div class="signup-page-button-text">GitHub 注册</div>
|
|
||||||
</div>
|
|
||||||
<div class="signup-page-button" @click="signupWithDiscord">
|
|
||||||
<img class="signup-page-button-icon" src="~/assets/icons/discord.svg" alt="Discord Logo" />
|
|
||||||
<div class="signup-page-button-text">Discord 注册</div>
|
|
||||||
</div>
|
|
||||||
<div class="signup-page-button" @click="signupWithTwitter">
|
|
||||||
<img class="signup-page-button-icon" src="~/assets/icons/twitter.svg" alt="Twitter Logo" />
|
|
||||||
<div class="signup-page-button-text">Twitter 注册</div>
|
|
||||||
</div>
|
|
||||||
<div class="signup-page-button" @click="signupWithTelegram">
|
|
||||||
<img
|
|
||||||
class="signup-page-button-icon"
|
|
||||||
src="~/assets/icons/telegram.svg"
|
|
||||||
alt="Telegram Logo"
|
|
||||||
/>
|
|
||||||
<div class="signup-page-button-text">Telegram 注册</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import BaseInput from '~/components/BaseInput.vue'
|
import BaseInput from '~/components/BaseInput.vue'
|
||||||
import { toast } from '~/main'
|
import { toast } from '~/main'
|
||||||
import { discordAuthorize } from '~/utils/discord'
|
|
||||||
import { githubAuthorize } from '~/utils/github'
|
|
||||||
import { googleAuthorize } from '~/utils/google'
|
|
||||||
import { twitterAuthorize } from '~/utils/twitter'
|
|
||||||
import { telegramAuthorize } from '~/utils/telegram'
|
|
||||||
import { loadCurrentUser, setToken } from '~/utils/auth'
|
import { loadCurrentUser, setToken } from '~/utils/auth'
|
||||||
|
import ThirdPartyAuth from '~/components/ThirdPartyAuth.vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
@@ -225,21 +196,6 @@ const verifyCode = async () => {
|
|||||||
isWaitingForEmailVerified.value = false
|
isWaitingForEmailVerified.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const signupWithGoogle = () => {
|
|
||||||
googleAuthorize(inviteToken.value)
|
|
||||||
}
|
|
||||||
const signupWithGithub = () => {
|
|
||||||
githubAuthorize(inviteToken.value)
|
|
||||||
}
|
|
||||||
const signupWithDiscord = () => {
|
|
||||||
discordAuthorize(inviteToken.value)
|
|
||||||
}
|
|
||||||
const signupWithTwitter = () => {
|
|
||||||
twitterAuthorize(inviteToken.value)
|
|
||||||
}
|
|
||||||
const signupWithTelegram = () => {
|
|
||||||
telegramAuthorize(inviteToken.value)
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -312,16 +268,6 @@ const signupWithTelegram = () => {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.other-signup-page-content {
|
|
||||||
margin-left: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 30%;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.signup-page-button-primary {
|
.signup-page-button-primary {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -351,29 +297,6 @@ const signupWithTelegram = () => {
|
|||||||
background-color: var(--primary-color-hover);
|
background-color: var(--primary-color-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.signup-page-button {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 10px 20px;
|
|
||||||
background-color: var(--login-background-color);
|
|
||||||
border: 1px solid var(--normal-border-color);
|
|
||||||
border-radius: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
min-width: 150px;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.signup-page-button:hover {
|
|
||||||
background-color: var(--login-background-color-hover);
|
|
||||||
}
|
|
||||||
|
|
||||||
.signup-page-button-icon {
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.signup-page-button-text {
|
.signup-page-button-text {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
@@ -423,16 +346,5 @@ const signupWithTelegram = () => {
|
|||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.other-signup-page-content {
|
|
||||||
margin-top: 20px;
|
|
||||||
margin-left: 0px;
|
|
||||||
width: calc(100% - 40px);
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.signup-page-button {
|
|
||||||
width: calc(100% - 40px);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import CallbackPage from '~/components/CallbackPage.vue'
|
import CallbackPage from '~/components/CallbackPage.vue'
|
||||||
|
import { I } from '~/dist/_nuxt/F7ewH_Zb'
|
||||||
import { telegramExchange } from '~/utils/telegram'
|
import { telegramExchange } from '~/utils/telegram'
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@@ -17,7 +18,8 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
let authData
|
let authData
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(decodeURIComponent(hash))
|
const decoded = atob(hash)
|
||||||
|
const parsed = JSON.parse(decoded)
|
||||||
authData = {
|
authData = {
|
||||||
id: String(parsed.id),
|
id: String(parsed.id),
|
||||||
firstName: parsed.first_name,
|
firstName: parsed.first_name,
|
||||||
|
|||||||
@@ -58,7 +58,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="profile-info-item">
|
<div class="profile-info-item">
|
||||||
<div class="profile-info-item-label">最后发帖时间:</div>
|
<div class="profile-info-item-label">最后发帖时间:</div>
|
||||||
<div class="profile-info-item-value">{{ formatDate(user.lastPostTime) }}</div>
|
<div class="profile-info-item-value">
|
||||||
|
{{ user.lastPostTime != null ? formatDate(user.lastPostTime) : '暂无帖子' }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="profile-info-item">
|
<div class="profile-info-item">
|
||||||
<div class="profile-info-item-label">最后评论时间:</div>
|
<div class="profile-info-item-label">最后评论时间:</div>
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export function telegramAuthorize(inviteToken = '') {
|
|||||||
const url =
|
const url =
|
||||||
`https://oauth.telegram.org/auth` +
|
`https://oauth.telegram.org/auth` +
|
||||||
`?bot_id=${encodeURIComponent(TELEGRAM_BOT_ID)}` +
|
`?bot_id=${encodeURIComponent(TELEGRAM_BOT_ID)}` +
|
||||||
`&origin=${encodeURIComponent(WEBSITE_BASE_URL)}` +
|
`&origin=${encodeURIComponent(redirectUri)}` +
|
||||||
`&request_access=write` +
|
`&request_access=write`
|
||||||
`&redirect_uri=${encodeURIComponent(redirectUri)}`
|
// `&redirect_uri=${encodeURIComponent(redirectUri)}`
|
||||||
window.location.href = url
|
window.location.href = url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user