fix wrong langue value when adding songs

This commit is contained in:
2024-11-21 00:53:15 +08:00
parent 45bc8485b3
commit 537ea7bbe6
52 changed files with 46594 additions and 394 deletions

View File

@@ -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) {