merge to bun

This commit is contained in:
2024-10-29 15:33:22 +08:00
parent ae14fa3078
commit 51897133a7
20 changed files with 385 additions and 7008 deletions

View File

@@ -4,6 +4,7 @@ import { BiliAuthCodeStatusType, BiliAuthModel } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import { ACCOUNT_API_URL, TURNSTILE_KEY } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore'
import { Info24Filled, Mic24Filled, Question24Regular } from '@vicons/fluent'
import { useLocalStorage } from '@vueuse/core'
import {
@@ -14,23 +15,25 @@ import {
NCountdown,
NDivider,
NEllipsis,
NFlex,
NIcon,
NInput,
NInputGroup,
NModal,
NPopconfirm,
NSpace,
NTabPane,
NTabs,
NTag,
NText,
NTime,
NTooltip,
useLoadingBar,
useMessage,
useMessage
} from 'naive-ui'
import { onUnmounted, ref } from 'vue'
import VueTurnstile from 'vue-turnstile'
import SettingsManageView from './SettingsManageView.vue'
import { useAuthStore } from '@/store/useAuthStore'
import Setting_PaymentView from './Setting_PaymentView.vue'
const token = ref('')
const turnstile = ref()
@@ -283,7 +286,7 @@ onUnmounted(() => {
</script>
<template>
<NSpace justify="center" align="center" vertical style="width: 100%">
<NFlex justify="center" align="center" vertical>
<NAlert type="warning" title="2024.2.26">
近期逸站对开放平台直播弹幕流进行了极为严格的限制, 目前本站服务器只能连接个位数的直播间, 这使得在不使用
<NButton tag="a" href="https://www.yuque.com/megghy/dez70g/vfvcyv3024xvaa1p" target="_blank" type="primary" text>
@@ -297,169 +300,162 @@ onUnmounted(() => {
</NButton>
以获得完整的功能体验
</NAlert>
<NCard embedded style="width: 100%">
<NSpace align="center" justify="center" vertical>
<NText style="font-size: 3rem">
{{ accountInfo?.name }}
</NText>
<NText style="color: gray">
<NTime :time="accountInfo?.createAt" />
注册
</NText>
</NSpace>
<NDivider>
<NText depth="3" style="font-size: 18px"> {{ accountInfo?.id }} </NText>
</NDivider>
<NSpace vertical>
<NCard size="small">
<NSpace :size="5">
邮箱:
<NEllipsis v-if="accountInfo?.isEmailVerified" style="max-width: 100%">
<NText style="color: var(--primary-color)"> 已认证 | {{ accountInfo?.bindEmail }} </NText>
</NEllipsis>
<template v-else>
<NTag type="error" size="small"> 认证 </NTag>
</template>
<NButton
v-if="accountInfo?.isEmailVerified"
type="warning"
size="tiny"
@click="resetEmailModalVisiable = true"
>
修改邮箱
</NButton>
</NSpace>
</NCard>
<NCard size="small">
主播 Bilibili 账户:
<NEllipsis v-if="accountInfo?.isBiliVerified" style="max-width: 100%">
<NText style="color: var(--primary-color)">
<NSpace :size="5" align="center">
已认证 | {{ accountInfo?.biliId }}
<NTag
v-if="accountInfo.biliAuthCodeStatus == BiliAuthCodeStatusType.Active"
type="success"
size="small"
:bordered="false"
>
身份码: 有效
</NTag>
<NTag
v-else-if="accountInfo.biliAuthCodeStatus == BiliAuthCodeStatusType.Inactive"
type="error"
size="small"
:bordered="false"
>
身份码: 需更新
</NTag>
<NTag
v-else-if="accountInfo.biliAuthCodeStatus == BiliAuthCodeStatusType.Notfound"
type="warning"
size="small"
:bordered="false"
>
身份码: 需绑定
<NTooltip>
<NTabs type="segment" animated v-if="accountInfo" style="width: 100%;">
<NTabPane name="info" tab="个人信息" style="width: 100%;" display-directive="show:lazy">
<NFlex justify="center" align="center">
<NCard embedded style="width: 100%;max-width: 800px;">
<NSpace align="center" justify="center" vertical>
<NText style="font-size: 3rem">
{{ accountInfo?.name }}
</NText>
<NText style="color: gray">
<NTime :time="accountInfo?.createAt" />
注册
</NText>
</NSpace>
<NDivider>
<NText depth="3" style="font-size: 18px"> {{ accountInfo?.id }} </NText>
</NDivider>
<NSpace vertical>
<NCard size="small">
<NSpace :size="5">
邮箱:
<NEllipsis v-if="accountInfo?.isEmailVerified" style="max-width: 100%">
<NText style="color: var(--primary-color)"> 认证 | {{ accountInfo?.bindEmail }} </NText>
</NEllipsis>
<template v-else>
<NTag type="error" size="small"> 未认证 </NTag>
</template>
<NButton v-if="accountInfo?.isEmailVerified" type="warning" size="tiny"
@click="resetEmailModalVisiable = true">
修改邮箱
</NButton>
</NSpace>
</NCard>
<NCard size="small">
主播 Bilibili 账户:
<NEllipsis v-if="accountInfo?.isBiliVerified" style="max-width: 100%">
<NText style="color: var(--primary-color)">
<NSpace :size="5" align="center">
已认证 | {{ accountInfo?.biliId }}
<NTag v-if="accountInfo.biliAuthCodeStatus == BiliAuthCodeStatusType.Active" type="success"
size="small" :bordered="false">
身份码: 有效
</NTag>
<NTag v-else-if="accountInfo.biliAuthCodeStatus == BiliAuthCodeStatusType.Inactive" type="error"
size="small" :bordered="false">
身份码: 需更新
</NTag>
<NTag v-else-if="accountInfo.biliAuthCodeStatus == BiliAuthCodeStatusType.Notfound" type="warning"
size="small" :bordered="false">
身份码: 需绑定
<NTooltip>
<template #trigger>
<NIcon :component="Mic24Filled" />
</template>
如果你不是主播的话则不需要在意这个提示
</NTooltip>
</NTag>
<NButton size="tiny" type="info" @click="bindBiliCodeModalVisiable = true"> 更新身份码 </NButton>
<NPopconfirm @positive-click="resetBili">
<template #trigger>
<NButton size="tiny" type="error"> 解除认证 </NButton>
</template>
确定解除认证吗? 解除后现有的数据跟踪数据将被删除并且无法恢复
</NPopconfirm>
</NSpace>
</NText>
</NEllipsis>
<template v-else>
<NTag type="error" size="small">
未绑定
<NTooltip>
<template #trigger>
<NIcon :component="Info24Filled" />
</template>
如果你不是主播的话则不需要在意这个
</NTooltip>
</NTag>
<NDivider vertical />
<NButton size="small" @click="bindBiliCodeModalVisiable = true" type="info"> 进行绑定 </NButton>
</template>
</NCard>
<NCard size="small">
用户 Bilibili 账户:
<NEllipsis v-if="accountInfo?.biliUserAuthInfo" style="max-width: 100%">
<NText style="color: var(--primary-color)">
<NSpace :size="5" align="center">
已绑定 | {{ accountInfo?.biliUserAuthInfo?.name }} [{{ accountInfo?.biliUserAuthInfo?.userId }}]
<NPopconfirm @positive-click="resetBiliAuthBind">
<template #trigger>
<NButton size="tiny" type="error"> 解除绑定 </NButton>
</template>
确定解除绑定吗?
</NPopconfirm>
</NSpace>
</NText>
</NEllipsis>
<template v-else>
<NTag type="error" size="small">
未认证
<NTooltip>
<template #trigger>
<NIcon :component="Info24Filled" />
</template>
用于进行积分兑换等操作, 如果你是主播可以不用管,
并且即使不绑定也可以直接用认证完成给出的链接查看和使用积分
</NTooltip>
</NTag>
<NDivider vertical />
<NButton size="small" @click="bindBiliAuthModalVisiable = true" type="info"> 进行认证 </NButton>
</template>
</NCard>
<EventFetcherStatusCard />
<NAlert title="Token" type="info">
请注意保管, 这个东西可以完全操作你的账号
<NInputGroup>
<NInput type="password" :value="accountInfo?.token" show-password-on="click" status="error" />
<NPopconfirm @positive-click="resetToken">
<template #trigger>
<NIcon :component="Mic24Filled" />
<NButton type="error"> 重置 </NButton>
</template>
如果你不是主播的话则不需要在意这个提示
</NTooltip>
</NTag>
<NButton size="tiny" type="info" @click="bindBiliCodeModalVisiable = true"> 更新身份码 </NButton>
<NPopconfirm @positive-click="resetBili">
<template #trigger>
<NButton size="tiny" type="error"> 解除认证 </NButton>
</template>
确定解除认证吗? 解除后现有的数据跟踪数据将被删除并且无法恢复
</NPopconfirm>
</NSpace>
</NText>
</NEllipsis>
<template v-else>
<NTag type="error" size="small">
未绑定
<NTooltip>
确定要重新生成 Token ? EventFetcher 等设施将需要重新部署
</NPopconfirm>
</NInputGroup>
</NAlert>
</NSpace>
<NDivider />
<NSpace justify="center">
<NButton type="info" @click="resetNameModalVisiable = true"> 修改用户名 </NButton>
<NButton type="warning" @click="resetPasswordModalVisiable = true"> 修改密码 </NButton>
<NPopconfirm @positive-click="logout">
<template #trigger>
<NIcon :component="Info24Filled" />
<NButton type="error"> 登出 </NButton>
</template>
如果你不是主播的话则不需要在意这个
</NTooltip>
</NTag>
<NDivider vertical />
<NButton size="small" @click="bindBiliCodeModalVisiable = true" type="info"> 进行绑定 </NButton>
</template>
</NCard>
<NCard size="small">
用户 Bilibili 账户:
<NEllipsis v-if="accountInfo?.biliUserAuthInfo" style="max-width: 100%">
<NText style="color: var(--primary-color)">
<NSpace :size="5" align="center">
已绑定 | {{ accountInfo?.biliUserAuthInfo?.name }} [{{ accountInfo?.biliUserAuthInfo?.userId }}]
<NPopconfirm @positive-click="resetBiliAuthBind">
<template #trigger>
<NButton size="tiny" type="error"> 解除绑定 </NButton>
</template>
确定解除绑定吗?
</NPopconfirm>
</NSpace>
</NText>
</NEllipsis>
<template v-else>
<NTag type="error" size="small">
未认证
<NTooltip>
<template #trigger>
<NIcon :component="Info24Filled" />
</template>
用于进行积分兑换等操作, 如果你是主播可以不用管,
并且即使不绑定也可以直接用认证完成给出的链接查看和使用积分
</NTooltip>
</NTag>
<NDivider vertical />
<NButton size="small" @click="bindBiliAuthModalVisiable = true" type="info"> 进行认证 </NButton>
</template>
</NCard>
<EventFetcherStatusCard />
<NAlert title="Token" type="info">
请注意保管, 这个东西可以完全操作你的账号
<NInputGroup>
<NInput type="password" :value="accountInfo?.token" show-password-on="click" status="error" />
<NPopconfirm @positive-click="resetToken">
<template #trigger>
<NButton type="error"> 重置 </NButton>
</template>
确定要重新生成 Token ? EventFetcher 等设施将需要重新部署
</NPopconfirm>
</NInputGroup>
</NAlert>
</NSpace>
<NDivider />
<NSpace justify="center">
<NButton type="info" @click="resetNameModalVisiable = true"> 修改用户名 </NButton>
<NButton type="warning" @click="resetPasswordModalVisiable = true"> 修改密码 </NButton>
<NPopconfirm @positive-click="logout">
<template #trigger>
<NButton type="error"> 登出 </NButton>
</template>
确定登出?
</NPopconfirm>
</NSpace>
</NCard>
</NSpace>
<div>
<NDivider />
<SettingsManageView />
<NDivider />
</div>
确定登出?
</NPopconfirm>
</NSpace>
</NCard>
</NFlex>
</NTabPane>
<NTabPane name="setting" tab="设置" display-directive="show:lazy">
<SettingsManageView />
</NTabPane>
<NTabPane name="payment" tab="增值" display-directive="show:lazy">
<Setting_PaymentView />
</NTabPane>
</NTabs>
</NFlex>
<NModal v-model:show="resetEmailModalVisiable" preset="card" title="改绑邮箱" style="width: 400px; max-width: 90%">
<NSpace vertical>
<NInput v-model:value="newEmailAddress" placeholder="新邮箱地址" />
<NInputGroup>
<NInput v-model:value="newEmailVerifyCode" placeholder="验证码" />
<NButton type="primary" @click="sendEmailVerifyCode">
发送验证码 <template v-if="!canSendEmailVerifyCode"> | <NCountdown :duration="60000" /> </template>
发送验证码 <template v-if="!canSendEmailVerifyCode"> |
<NCountdown :duration="60000" />
</template>
</NButton>
</NInputGroup>
</NSpace>
@@ -484,12 +480,7 @@ onUnmounted(() => {
<NButton @click="resetName" type="warning" :loading="isLoading"> 确定修改 </NButton>
</template>
</NModal>
<NModal
v-model:show="bindBiliCodeModalVisiable"
preset="card"
title="绑定/更新身份码"
style="width: 400px; max-width: 90%"
>
<NModal v-model:show="bindBiliCodeModalVisiable" preset="card" title="绑定/更新身份码" style="width: 400px; max-width: 90%">
<NSpace vertical>
<NInputGroup>
<NInput v-model:value="biliCode" placeholder="身份码" />
@@ -509,21 +500,13 @@ onUnmounted(() => {
</NInputGroup>
</NSpace>
<template #footer>
<NButton
@click="accountInfo?.isBiliVerified ? ChangeBili() : BindBili()"
type="success"
:loading="!token || isLoading"
>
<NButton @click="accountInfo?.isBiliVerified ? ChangeBili() : BindBili()" type="success"
:loading="!token || isLoading">
确定
</NButton>
</template>
</NModal>
<NModal
v-model:show="bindBiliAuthModalVisiable"
preset="card"
title="绑定用户账户"
style="width: 700px; max-width: 90%"
>
<NModal v-model:show="bindBiliAuthModalVisiable" preset="card" title="绑定用户账户" style="width: 700px; max-width: 90%">
<NSpace vertical>
<NAlert title="获取认证链接" type="info">
因为部分功能如积分兑换等也需要对没有注册本站账户的用户开放, 所以需要现在另一个页面获取认证链接,

View File

@@ -0,0 +1,26 @@
<script setup lang="ts">
import { useAccount } from '@/api/account';
import { onMounted } from 'vue';
const accountInfo = useAccount()
const { } = defineProps<{
}>()
async function getAccountPaymentSettings() {
try {
} catch (error) {
console.error(error)
}
}
onMounted(() => {
getAccountPaymentSettings()
});
</script>
<template>
WIP...
</template>