mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
update alert
This commit is contained in:
35
src/views/manage/DanmakuLayout.vue
Normal file
35
src/views/manage/DanmakuLayout.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import { useAccount } from '@/api/account'
|
||||
import DanmakuClient from '@/data/DanmakuClient'
|
||||
import { NAlert, NSpin, useMessage } from 'naive-ui'
|
||||
import { VNode, onMounted, onUnmounted, ref } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
component: VNode
|
||||
}>()
|
||||
|
||||
const accountInfo = useAccount()
|
||||
const message = useMessage()
|
||||
|
||||
let client = new DanmakuClient(null)
|
||||
const isClientLoading = ref(true)
|
||||
|
||||
onMounted(async () => {
|
||||
const result = await client.Start()
|
||||
if (!result.success) {
|
||||
message.error('无法启动弹幕客户端: ' + result.message)
|
||||
}
|
||||
isClientLoading.value = false
|
||||
})
|
||||
onUnmounted(() => {
|
||||
client.Stop()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NAlert v-if="accountInfo?.isBiliVerified != true" type="info"> 尚未进行Bilibili认证 </NAlert>
|
||||
<NSpin v-else-if="isClientLoading" show />
|
||||
<KeepAlive v-else>
|
||||
<component :is="component" :client="client" :room-info="client.roomAuthInfo?.value" :code="accountInfo?.biliAuthCode"/>
|
||||
</KeepAlive>
|
||||
</template>
|
||||
@@ -66,7 +66,7 @@ const lotteryHistory = useStorage<LotteryHistory[]>('LotteryHistory', [])
|
||||
|
||||
const message = useMessage()
|
||||
const notification = useNotification()
|
||||
const token = ref()
|
||||
const token = ref('')
|
||||
const turnstile = ref()
|
||||
const defaultOption = {
|
||||
resultCount: 1,
|
||||
|
||||
Reference in New Issue
Block a user