diff --git a/src/client/store/useBiliCookie.ts b/src/client/store/useBiliCookie.ts
index 280fee7..08c0c27 100644
--- a/src/client/store/useBiliCookie.ts
+++ b/src/client/store/useBiliCookie.ts
@@ -15,7 +15,7 @@ export const USER_INFO_CACHE_KEY = 'cache.bilibili.userInfo'
// 检查周期 (毫秒)
const REGULAR_CHECK_INTERVAL = 60 * 1000 // 每分钟检查一次 Cookie 有效性
-const CLOUD_SYNC_INTERVAL_CHECKS = 30 // 每 30 次常规检查后 (约 30 分钟) 同步一次 CookieCloud
+const CLOUD_SYNC_INTERVAL_CHECKS = 10 // 每 10 次常规检查后 (约 10 分钟) 同步一次 CookieCloud
// 用户信息缓存有效期 (毫秒)
const USER_INFO_CACHE_DURATION = 5 * 60 * 1000 // 缓存 5 分钟
@@ -381,6 +381,9 @@ export const useBiliCookie = defineStore('biliCookie', () => {
_checkIntervalId = setInterval(check, REGULAR_CHECK_INTERVAL)
info(`[BiliCookie] 定时检查已启动,周期: ${REGULAR_CHECK_INTERVAL / 1000} 秒`)
+ // 立即执行一次检查,强制尝试从 CookieCloud 同步
+ await check(true)
+
info('[BiliCookie] Store 初始化完成')
}
diff --git a/src/components.d.ts b/src/components.d.ts
index 65231c9..6157140 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -49,6 +49,7 @@ declare module 'vue' {
NSpin: typeof import('naive-ui')['NSpin']
NStatistic: typeof import('naive-ui')['NStatistic']
NSwitch: typeof import('naive-ui')['NSwitch']
+ NTable: typeof import('naive-ui')['NTable']
NTag: typeof import('naive-ui')['NTag']
NText: typeof import('naive-ui')['NText']
NTime: typeof import('naive-ui')['NTime']
@@ -117,6 +118,7 @@ declare global {
const NSpin: typeof import('naive-ui')['NSpin']
const NStatistic: typeof import('naive-ui')['NStatistic']
const NSwitch: typeof import('naive-ui')['NSwitch']
+ const NTable: typeof import('naive-ui')['NTable']
const NTag: typeof import('naive-ui')['NTag']
const NText: typeof import('naive-ui')['NText']
const NTime: typeof import('naive-ui')['NTime']
diff --git a/src/store/useWebFetcher.ts b/src/store/useWebFetcher.ts
index b3fd6ba..784cc79 100644
--- a/src/store/useWebFetcher.ts
+++ b/src/store/useWebFetcher.ts
@@ -95,6 +95,14 @@ export const useWebFetcher = defineStore('WebFetcher', () => {
}
let danmakuResult = await connectDanmakuClient(type, directAuthInfo)
+ if (!danmakuResult?.success) {
+ window.$notification?.create({
+ title: '弹幕客户端启动失败',
+ content: danmakuResult?.message || '无法连接到弹幕服务器',
+ type: 'error',
+ duration: 5000,
+ })
+ }
while (!danmakuResult?.success) {
console.log(`${prefix.value}弹幕客户端启动失败, 5秒后重试`)
await new Promise(resolve => setTimeout(resolve, 5000))
diff --git a/src/views/ManageLayout.vue b/src/views/ManageLayout.vue
index df72a08..c997ab2 100644
--- a/src/views/ManageLayout.vue
+++ b/src/views/ManageLayout.vue
@@ -50,7 +50,7 @@ import { computed, h, onMounted, onUnmounted, ref, watch } from 'vue'
import APlayer from 'vue3-aplayer'
import { RouterLink, useRoute } from 'vue-router'
import { cookie, isLoadingAccount, useAccount } from '@/api/account'
-import { ThemeType } from '@/api/api-models'
+import { BiliAuthCodeStatusType, ThemeType } from '@/api/api-models'
import { QueryGetAPI } from '@/api/query'
import RegisterAndLogin from '@/components/RegisterAndLogin.vue'
import { ACCOUNT_API_URL, availableAPIs, selectedAPIKey } from '@/data/constants'
@@ -315,13 +315,13 @@ const menuOptions = computed(() => {
label: () => !isBiliVerified.value
? '弹幕机'
: h(NTooltip, {}, {
- trigger: () => h(
- RouterLink,
- { to: { name: 'manage-danmuji' } },
- { default: () => '弹幕机' },
- ),
- default: () => '兼容 blivechat 样式 (其实就是直接用的 blivechat 组件',
- }),
+ trigger: () => h(
+ RouterLink,
+ { to: { name: 'manage-danmuji' } },
+ { default: () => '弹幕机' },
+ ),
+ default: () => '兼容 blivechat 样式 (其实就是直接用的 blivechat 组件',
+ }),
key: 'manage-danmuji',
disabled: !isBiliVerified.value,
icon: renderIcon(Lottery24Filled),
@@ -331,17 +331,17 @@ const menuOptions = computed(() => {
label: () => !isBiliVerified.value
? '点播'
: h(
- NTooltip,
- {},
- {
- trigger: () => h(
- RouterLink,
- { to: { name: 'manage-liveRequest' } },
- { default: () => '点播' },
- ),
- default: () => '歌势之类用的, 可以用来点歌或者跳舞什么的',
- },
- ),
+ NTooltip,
+ {},
+ {
+ trigger: () => h(
+ RouterLink,
+ { to: { name: 'manage-liveRequest' } },
+ { default: () => '点播' },
+ ),
+ default: () => '歌势之类用的, 可以用来点歌或者跳舞什么的',
+ },
+ ),
key: 'manage-liveRequest',
icon: renderIcon(MusicalNote),
disabled: !isBiliVerified.value,
@@ -351,10 +351,10 @@ const menuOptions = computed(() => {
label: () => !isBiliVerified.value
? '抽奖'
: h(
- RouterLink,
- { to: { name: 'manage-liveLottery' } },
- { default: () => '抽奖' },
- ),
+ RouterLink,
+ { to: { name: 'manage-liveLottery' } },
+ { default: () => '抽奖' },
+ ),
key: 'manage-liveLottery',
icon: renderIcon(Lottery24Filled),
disabled: !isBiliVerified.value,
@@ -364,17 +364,17 @@ const menuOptions = computed(() => {
label: () => !isBiliVerified.value
? '点歌'
: h(
- NTooltip,
- {},
- {
- trigger: () => h(
- RouterLink,
- { to: { name: 'manage-musicRequest' } },
- { default: () => '点歌机' },
- ),
- default: () => '就是传统的点歌机, 发弹幕后播放指定的歌曲',
- },
- ),
+ NTooltip,
+ {},
+ {
+ trigger: () => h(
+ RouterLink,
+ { to: { name: 'manage-musicRequest' } },
+ { default: () => '点歌机' },
+ ),
+ default: () => '就是传统的点歌机, 发弹幕后播放指定的歌曲',
+ },
+ ),
key: 'manage-musicRequest',
icon: renderIcon(MusicalNote),
disabled: !isBiliVerified.value,
@@ -384,10 +384,10 @@ const menuOptions = computed(() => {
label: () => !isBiliVerified.value
? '排队'
: h(
- RouterLink,
- { to: { name: 'manage-liveQueue' } },
- { default: () => '排队' },
- ),
+ RouterLink,
+ { to: { name: 'manage-liveQueue' } },
+ { default: () => '排队' },
+ ),
key: 'manage-liveQueue',
icon: renderIcon(PeopleQueue24Filled),
disabled: !isBiliVerified.value,
@@ -397,10 +397,10 @@ const menuOptions = computed(() => {
label: () => !isBiliVerified.value
? '读弹幕'
: h(
- RouterLink,
- { to: { name: 'manage-speech' } },
- { default: () => '读弹幕' },
- ),
+ RouterLink,
+ { to: { name: 'manage-speech' } },
+ { default: () => '读弹幕' },
+ ),
key: 'manage-speech',
icon: renderIcon(TabletSpeaker24Filled),
disabled: !isBiliVerified.value,
@@ -649,16 +649,21 @@ function gotoAuthPage() {
}
onMounted(() => {
- // 检查邮箱验证状态
- if (accountInfo.value?.isEmailVerified === false) {
- if ((accountInfo.value?.nextSendEmailTime ?? -1) <= 0) {
- canResendEmail.value = true
- }
- }
if (selectedAPIKey.value != 'main') {
message.warning('你当前使用的是备用API节点, 可能会速度比较慢')
}
+ setTimeout(() => {
+ // 检查邮箱验证状态
+ if (accountInfo.value?.isEmailVerified === false) {
+ if ((accountInfo.value?.nextSendEmailTime ?? -1) <= 0) {
+ canResendEmail.value = true
+ }
+ }
+ if (accountInfo.value?.biliAuthCodeStatus == BiliAuthCodeStatusType.Inactive) {
+ message.error('你的身份码已失效, 请及时更新', { duration: 5000, closable: true })
+ }
+ }, 500);
})
onUnmounted(() => {
@@ -682,10 +687,8 @@ onUnmounted(() => {
- (themeType = value ? ThemeType.Light : ThemeType.Dark)"
- >
+ (themeType = value ? ThemeType.Light : ThemeType.Dark)">
@@ -693,10 +696,8 @@ onUnmounted(() => {
-
+
回到展示页
@@ -707,11 +708,9 @@ onUnmounted(() => {
-
+ :scrollbar-props="{ trigger: 'none', style: {} }" :class="{ 'sider-collapsed': width < 150 }">
@@ -746,14 +745,12 @@ onUnmounted(() => {
-
+ :options="menuOptions" />
@@ -772,8 +769,7 @@ onUnmounted(() => {
+ :style="`font-size: 12px; text-align: center;color: ${isDarkMode ? '#555' : '#c0c0c0'};visibility: ${width < 180 ? 'hidden' : 'visible'}`">
By Megghy
@@ -782,10 +778,10 @@ onUnmounted(() => {
-
+
+ content-style="margin: var(--vtsuru-content-padding); margin-right: calc(var(--vtsuru-content-padding) + 4px); padding-bottom: 32px;min-width: 370px">
@@ -840,10 +836,8 @@ onUnmounted(() => {
-
+
@@ -852,10 +846,8 @@ onUnmounted(() => {
重新发送验证邮件
-
+
后可重新发送
@@ -884,19 +876,15 @@ onUnmounted(() => {
-