mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
particularly complete forum function, add point order export and user delete
This commit is contained in:
@@ -199,7 +199,10 @@ onMounted(async () => {
|
||||
<NCard v-else style="max-width: 600px" embedded hoverable>
|
||||
<template #header> 你好, {{ useAuth.biliAuth.name }} </template>
|
||||
<template #header-extra>
|
||||
<NButton type="info" @click="gotoAuthPage" secondary size="small"> 前往认证用户中心 </NButton>
|
||||
<NFlex>
|
||||
<NButton type="info" @click="gotoAuthPage" secondary size="small"> 前往认证用户中心 </NButton>
|
||||
<NButton @click="NavigateToNewTab('/bili-user#settings')" secondary size="small"> 切换账号 </NButton>
|
||||
</NFlex>
|
||||
</template>
|
||||
<NText> 你在 {{ userInfo.extra?.streamerInfo?.name ?? userInfo.name }} 的直播间的积分为 {{ currentPoint }} </NText>
|
||||
</NCard>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ResponsePointOrder2UserModel } from '@/api/api-models'
|
||||
import PointOrderCard from '@/components/manage/PointOrderCard.vue'
|
||||
import { POINT_API_URL } from '@/data/constants'
|
||||
import { useAuthStore } from '@/store/useAuthStore'
|
||||
import { NEmpty, useMessage } from 'naive-ui'
|
||||
import { NEmpty, NSpin, useMessage } from 'naive-ui'
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
const message = useMessage()
|
||||
@@ -24,8 +24,9 @@ async function getOrders() {
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
message.error('获取订单失败: ' + err)
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
isLoading.value = false
|
||||
return []
|
||||
}
|
||||
|
||||
@@ -35,6 +36,8 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NEmpty v-if="orders.length == 0" description="暂无订单"></NEmpty>
|
||||
<PointOrderCard v-else :order="orders" :loading="isLoading" type="user" />
|
||||
<NSpin :show="isLoading">
|
||||
<NEmpty v-if="orders.length == 0" description="暂无订单" />
|
||||
<PointOrderCard v-else :order="orders" :loading="isLoading" type="user" />
|
||||
</NSpin>
|
||||
</template>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ResponsePointHisrotyModel } from '@/api/api-models'
|
||||
import PointHistoryCard from '@/components/manage/PointHistoryCard.vue'
|
||||
import { POINT_API_URL } from '@/data/constants'
|
||||
import { useAuthStore } from '@/store/useAuthStore'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { NSpin, useMessage } from 'naive-ui'
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
const message = useMessage()
|
||||
@@ -26,6 +26,8 @@ async function getHistories() {
|
||||
} catch (err) {
|
||||
message.error('获取积分历史失败: ' + err)
|
||||
console.error(err)
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
return []
|
||||
}
|
||||
@@ -36,5 +38,7 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PointHistoryCard :histories="history" />
|
||||
<NSpin :show="isLoading">
|
||||
<PointHistoryCard :histories="history" />
|
||||
</NSpin>
|
||||
</template>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { POINT_API_URL } from '@/data/constants'
|
||||
import { useAuthStore } from '@/store/useAuthStore'
|
||||
import { useRouteHash } from '@vueuse/router'
|
||||
import {
|
||||
NAlert,
|
||||
NButton,
|
||||
NCard,
|
||||
NDataTable,
|
||||
@@ -123,11 +124,12 @@ onMounted(async () => {
|
||||
|
||||
<template>
|
||||
<NLayout>
|
||||
<NSpin v-if="!biliAuth.id && useAuth.currentToken" :show="useAuth.isLoading" />
|
||||
<NSpin v-if="useAuth.isLoading && useAuth.currentToken" :show="useAuth.isLoading" />
|
||||
<NLayoutContent
|
||||
v-else-if="!useAuth.currentToken && useAuth.biliTokens.length > 0"
|
||||
v-else-if="(!useAuth.currentToken && useAuth.biliTokens.length > 0) || useAuth.isInvalid"
|
||||
style="height: 100vh; padding: 50px"
|
||||
>
|
||||
<NAlert v-if="useAuth.isInvalid" type="error"> 当前登录的 Bilibili 账号已失效 </NAlert>
|
||||
<NCard title="选择B站账号" embedded>
|
||||
<template #header-extra>
|
||||
<NButton type="primary" @click="$router.push({ name: 'bili-auth' })" size="small" secondary
|
||||
@@ -142,6 +144,7 @@ onMounted(async () => {
|
||||
</NCard>
|
||||
</NLayoutContent>
|
||||
<NLayoutContent v-else-if="!useAuth.currentToken" style="height: 100vh">
|
||||
<NAlert v-if="useAuth.isInvalid" type="error"> 当前登录的 Bilibili 账号已失效 </NAlert>
|
||||
<NResult status="error" title="你还未进行过B站账户验证" description="请先进行认证" style="padding-top: 64px">
|
||||
<template #footer>
|
||||
<NButton type="primary" @click="$router.push({ name: 'bili-auth' })">去认证</NButton>
|
||||
@@ -156,7 +159,7 @@ onMounted(async () => {
|
||||
</NLayoutHeader>
|
||||
<NLayoutContent content-style="padding: 24px;">
|
||||
<NFlex align="center" justify="center">
|
||||
<div style="max-width: 95vw; width: 900px">
|
||||
<div style="max-width: 95vw; width: 1200px">
|
||||
<NCard title="我的信息">
|
||||
<NDescriptions label-placement="left" bordered size="small">
|
||||
<NDescriptionsItem label="用户名">
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
NSelect,
|
||||
NSpin,
|
||||
NTag,
|
||||
NText,
|
||||
useMessage,
|
||||
} from 'naive-ui'
|
||||
import { computed, ref } from 'vue'
|
||||
@@ -284,7 +285,7 @@ function logout() {
|
||||
<NListItem v-for="item in useAuth.biliTokens" :key="item.token" @click="switchAuth(item.token)">
|
||||
<NFlex align="center">
|
||||
<NTag v-if="useAuth.biliToken == item.token" type="info"> 当前账号 </NTag>
|
||||
{{ item.uId }}
|
||||
{{ item.name }} <NDivider vertical style="margin: 0" /><NText depth="3"> {{ item.uId }} </NText>
|
||||
</NFlex>
|
||||
</NListItem>
|
||||
</NList>
|
||||
|
||||
Reference in New Issue
Block a user