mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
fix wrong langue value when adding songs
This commit is contained in:
70
src/main.ts
70
src/main.ts
@@ -9,6 +9,7 @@ import { GetSelfAccount, UpdateAccountLoop, useAccount } from './api/account'
|
||||
import { GetNotifactions } from './data/notifactions'
|
||||
import router from './router'
|
||||
import { useAuthStore } from './store/useAuthStore'
|
||||
import { useVTsuruHub } from './store/useVTsuruHub'
|
||||
|
||||
const pinia = createPinia()
|
||||
|
||||
@@ -35,41 +36,59 @@ QueryGetAPI<string>(BASE_API_URL + 'vtsuru/version')
|
||||
title: '发现新的版本更新',
|
||||
content: '将自动刷新页面',
|
||||
duration: 5000,
|
||||
meta: () => h(NText, { depth: 3 }, () => currentVersion),
|
||||
meta: () => h(NText, { depth: 3 }, () => currentVersion)
|
||||
})
|
||||
} else {
|
||||
setInterval(() => {
|
||||
if (isHaveNewVersion) {
|
||||
return
|
||||
}
|
||||
QueryGetAPI<string>(BASE_API_URL + 'vtsuru/version').then((keepCheckData) => {
|
||||
if (keepCheckData.code == 200 && keepCheckData.data != currentVersion) {
|
||||
isHaveNewVersion = true
|
||||
currentVersion = keepCheckData.data
|
||||
localStorage.setItem('Version', currentVersion)
|
||||
console.log('[vtsuru] 发现新版本: ' + currentVersion)
|
||||
QueryGetAPI<string>(BASE_API_URL + 'vtsuru/version').then(
|
||||
(keepCheckData) => {
|
||||
if (
|
||||
keepCheckData.code == 200 &&
|
||||
keepCheckData.data != currentVersion
|
||||
) {
|
||||
isHaveNewVersion = true
|
||||
currentVersion = keepCheckData.data
|
||||
localStorage.setItem('Version', currentVersion)
|
||||
console.log('[vtsuru] 发现新版本: ' + currentVersion)
|
||||
|
||||
const url = new URL(window.location.href)
|
||||
const path = url.pathname
|
||||
const url = new URL(window.location.href)
|
||||
const path = url.pathname
|
||||
|
||||
if (!path.startsWith('/obs')) {
|
||||
const n = notification.info({
|
||||
title: '发现新的版本更新',
|
||||
content: '是否现在刷新?',
|
||||
meta: () => h(NText, { depth: 3 }, () => currentVersion),
|
||||
action: () =>
|
||||
h(NFlex, null, () => [
|
||||
h(
|
||||
NButton,
|
||||
{ text: true, type: 'primary', onClick: () => location.reload(), size: 'small' },
|
||||
{ default: () => '刷新' },
|
||||
),
|
||||
h(NButton, { text: true, onClick: () => n.destroy(), size: 'small' }, { default: () => '稍后' }),
|
||||
]),
|
||||
})
|
||||
if (!path.startsWith('/obs')) {
|
||||
const n = notification.info({
|
||||
title: '发现新的版本更新',
|
||||
content: '是否现在刷新?',
|
||||
meta: () => h(NText, { depth: 3 }, () => currentVersion),
|
||||
action: () =>
|
||||
h(NFlex, null, () => [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
text: true,
|
||||
type: 'primary',
|
||||
onClick: () => location.reload(),
|
||||
size: 'small'
|
||||
},
|
||||
{ default: () => '刷新' }
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
text: true,
|
||||
onClick: () => n.destroy(),
|
||||
size: 'small'
|
||||
},
|
||||
{ default: () => '稍后' }
|
||||
)
|
||||
])
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
)
|
||||
}, 60 * 1000)
|
||||
}
|
||||
}
|
||||
@@ -82,6 +101,7 @@ QueryGetAPI<string>(BASE_API_URL + 'vtsuru/version')
|
||||
//加载其他数据
|
||||
await GetSelfAccount()
|
||||
const account = useAccount()
|
||||
const vhub = useVTsuruHub().Init(account.value.token)
|
||||
const useAuth = useAuthStore()
|
||||
if (account.value.id) {
|
||||
if (account.value.biliUserAuthInfo && !useAuth.currentToken) {
|
||||
|
||||
Reference in New Issue
Block a user