mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
add not connect alert
This commit is contained in:
@@ -29,8 +29,9 @@ import {
|
||||
useMessage,
|
||||
NDivider,
|
||||
NTag,
|
||||
NAlert,
|
||||
} from 'naive-ui'
|
||||
import { ref, onMounted, h } from 'vue'
|
||||
import { ref, onMounted, h, onUnmounted } from 'vue'
|
||||
import { RouterLink, useRoute } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -89,6 +90,9 @@ onMounted(async () => {
|
||||
message.error('你不是从幻星平台访问此页面, 或未提供对应参数, 无法使用此功能')
|
||||
}
|
||||
})
|
||||
onUnmounted(() => {
|
||||
client.value?.Stop()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -108,7 +112,7 @@ onMounted(async () => {
|
||||
<NPageHeader :subtitle="($route.meta.title as string) ?? ''">
|
||||
<template #extra>
|
||||
<NSpace align="center">
|
||||
<NTag :type="client ? 'success' : 'warning'"> {{ client ? `已连接 | ${client.roomAuthInfo.value?.anchor_info.uname}` : '未连接' }} </NTag>
|
||||
<NTag :type="client?.roomAuthInfo.value ? 'success' : 'warning'"> {{ client?.roomAuthInfo.value ? `已连接 | ${client.roomAuthInfo.value?.anchor_info.uname}` : '未连接' }} </NTag>
|
||||
<NSwitch :default-value="!isDarkMode()" @update:value="(value: string & number & boolean) => themeType = value ? ThemeType.Light : ThemeType.Dark">
|
||||
<template #checked>
|
||||
<NIcon :component="Sunny" />
|
||||
@@ -152,14 +156,16 @@ onMounted(async () => {
|
||||
</NText>
|
||||
</NSpace>
|
||||
</NLayoutSider>
|
||||
<NLayoutContent yle="height: 100%" :native-scrollbar="false">
|
||||
<RouterView v-if="client?.roomAuthInfo" v-slot="{ Component }">
|
||||
<NLayoutContent style="height: 100%; padding: 10px;" :native-scrollbar="false">
|
||||
<RouterView v-if="client?.roomAuthInfo.value" v-slot="{ Component }">
|
||||
<KeepAlive>
|
||||
<component :is="Component" :room-info="client?.roomAuthInfo" :client="client" :code="authInfo.Code" />
|
||||
</KeepAlive>
|
||||
</RouterView>
|
||||
<template v-else>
|
||||
<NSpin show />
|
||||
<NAlert type="info" title="正在请求弹幕客户端认证信息...">
|
||||
<NSpin show />
|
||||
</NAlert>
|
||||
</template>
|
||||
<NBackTop />
|
||||
</NLayoutContent>
|
||||
|
||||
Reference in New Issue
Block a user