mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
improve point functions
This commit is contained in:
@@ -164,11 +164,12 @@ function gotoAuthPage() {
|
||||
message.error('你尚未进行 Bilibili 认证, 请前往面板进行认证和绑定')
|
||||
return
|
||||
}
|
||||
useAuthStore()
|
||||
/*useAuthStore()
|
||||
.setCurrentAuth(accountInfo.value?.biliUserAuthInfo.token)
|
||||
.then(() => {
|
||||
NavigateToNewTab('/bili-user')
|
||||
})
|
||||
})*/
|
||||
NavigateToNewTab('/bili-user')
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -212,7 +213,13 @@ onMounted(async () => {
|
||||
<NFlex justify="space-between" align="center">
|
||||
<NTooltip>
|
||||
<template #trigger>
|
||||
<NButton :disabled="getTooltip(item) != '开始兑换'" size="small" type="primary" @click="onBuyClick(item)">兑换</NButton>
|
||||
<NButton
|
||||
:disabled="getTooltip(item) != '开始兑换'"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="onBuyClick(item)"
|
||||
>兑换</NButton
|
||||
>
|
||||
</template>
|
||||
{{ getTooltip(item) }}
|
||||
</NTooltip>
|
||||
|
||||
@@ -124,8 +124,16 @@ onMounted(async () => {
|
||||
<template>
|
||||
<NLayout>
|
||||
<NSpin v-if="!biliAuth.id && useAuth.currentToken" :show="useAuth.isLoading" />
|
||||
<NLayoutContent v-else-if="!useAuth.currentToken && useAuth.biliTokens.length > 0" style="height: 100vh">
|
||||
<NLayoutContent
|
||||
v-else-if="!useAuth.currentToken && useAuth.biliTokens.length > 0"
|
||||
style="height: 100vh; padding: 50px"
|
||||
>
|
||||
<NCard title="选择B站账号" embedded>
|
||||
<template #header-extra>
|
||||
<NButton type="primary" @click="$router.push({ name: 'bili-auth' })" size="small" secondary
|
||||
>认证其他账号</NButton
|
||||
>
|
||||
</template>
|
||||
<NList clickable bordered>
|
||||
<NListItem v-for="item in useAuth.biliTokens" :key="item.token" @click="switchAuth(item.token)">
|
||||
<NFlex align="center"> {{ item.name }} - {{ item.uId }} </NFlex>
|
||||
@@ -151,12 +159,15 @@ onMounted(async () => {
|
||||
<div style="max-width: 95vw; width: 900px">
|
||||
<NCard title="我的信息">
|
||||
<NDescriptions label-placement="left" bordered size="small">
|
||||
<NDescriptionsItem label="OpenId">
|
||||
{{ biliAuth.openId }}
|
||||
<NDescriptionsItem label="用户名">
|
||||
{{ biliAuth.name ?? '未知' }}
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem label="UserId">
|
||||
{{ biliAuth.userId }}
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem label="OpenId">
|
||||
{{ biliAuth.openId }}
|
||||
</NDescriptionsItem>
|
||||
</NDescriptions>
|
||||
</NCard>
|
||||
<NDivider />
|
||||
|
||||
@@ -5,27 +5,27 @@ import { POINT_API_URL, THINGS_URL } from '@/data/constants'
|
||||
import { useAuthStore } from '@/store/useAuthStore'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import {
|
||||
FormRules,
|
||||
NButton,
|
||||
NCard,
|
||||
NCheckbox,
|
||||
NCollapse,
|
||||
NCollapseItem,
|
||||
NDivider,
|
||||
NFlex,
|
||||
NForm,
|
||||
NFormItem,
|
||||
NInput,
|
||||
NInputNumber,
|
||||
NList,
|
||||
NListItem,
|
||||
NModal,
|
||||
NPopconfirm,
|
||||
NScrollbar,
|
||||
NSelect,
|
||||
NSpin,
|
||||
NTag,
|
||||
useMessage
|
||||
FormRules,
|
||||
NButton,
|
||||
NCard,
|
||||
NCheckbox,
|
||||
NCollapse,
|
||||
NCollapseItem,
|
||||
NDivider,
|
||||
NFlex,
|
||||
NForm,
|
||||
NFormItem,
|
||||
NInput,
|
||||
NInputNumber,
|
||||
NList,
|
||||
NListItem,
|
||||
NModal,
|
||||
NPopconfirm,
|
||||
NScrollbar,
|
||||
NSelect,
|
||||
NSpin,
|
||||
NTag,
|
||||
useMessage,
|
||||
} from 'naive-ui'
|
||||
import { computed, ref } from 'vue'
|
||||
//@ts-expect-error 导入有点问题
|
||||
@@ -223,6 +223,10 @@ function switchAuth(token: string) {
|
||||
useAuth.setCurrentAuth(token)
|
||||
message.success('已切换账号')
|
||||
}
|
||||
|
||||
function logout() {
|
||||
useAuth.logout()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -261,9 +265,20 @@ function switchAuth(token: string) {
|
||||
</NList>
|
||||
</NFlex>
|
||||
</NCollapseItem>
|
||||
<NCollapseItem title="登录链接" name="2">
|
||||
<NInput type="textarea" :value="'https://vtsuru.live/bili-user?auth=' + useAuth.biliToken" readonly />
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
</NCard>
|
||||
<NCard title="账号操作" embedded>
|
||||
<NFlex>
|
||||
<NPopconfirm @positive-click="logout">
|
||||
<template #trigger>
|
||||
<NButton type="warning" size="small"> 登出 </NButton>
|
||||
</template>
|
||||
确定要登出吗?
|
||||
</NPopconfirm>
|
||||
</NFlex>
|
||||
<NDivider> 切换账号 </NDivider>
|
||||
<NList clickable bordered>
|
||||
<NListItem v-for="item in useAuth.biliTokens" :key="item.token" @click="switchAuth(item.token)">
|
||||
|
||||
Reference in New Issue
Block a user