|
-
-
{{ tag }}
-
-
+
+
|
@@ -1175,7 +1174,6 @@ html.dark .filter-input::placeholder {
line-height: 28px; /* Adjust if needed */
}
-
/* --- Random Button Styling (Keep Existing) --- */
.refresh-button {
height: 30px;
@@ -1239,7 +1237,6 @@ html.dark .song-list-template {
&::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-color-active); }
}
-
/* --- MODIFIED: Main Content Container --- */
.profile-card-container {
position: relative; /* Keep for potential absolute children if any */
@@ -1426,7 +1423,6 @@ html.dark .song-list-table thead th {
.song-list-table th:nth-child(5) { width: 15%; }
.song-list-table th:nth-child(6) { width: 25%; }
-
.song-list-table tbody tr { transition: background-color 0.15s ease; }
.song-list-table tbody td {
@@ -1547,5 +1543,4 @@ html.dark .language-link.selected-language {
html.dark .empty-placeholder {
color: var(--text-color-3); /* Use theme variable for dark mode */
}
-
-
\ No newline at end of file
+
diff --git a/src/views/view/songListTemplate/utils/songRequestUtils.ts b/src/views/view/songListTemplate/utils/songRequestUtils.ts
index 2b5341f..3443016 100644
--- a/src/views/view/songListTemplate/utils/songRequestUtils.ts
+++ b/src/views/view/songListTemplate/utils/songRequestUtils.ts
@@ -1,6 +1,6 @@
+import type { Setting_LiveRequest, SongsInfo, UserInfo } from '@/api/api-models'
import { useAccount } from '@/api/account'
-import { Setting_LiveRequest, SongsInfo, UserInfo } from '@/api/api-models'
-import { useBiliAuth } from '@/store/useBiliAuth';
+import { useBiliAuth } from '@/store/useBiliAuth'
/**
* 获取点歌按钮的tooltip文本
@@ -12,10 +12,10 @@ import { useBiliAuth } from '@/store/useBiliAuth';
*/
export function getSongRequestTooltip(
song: SongsInfo,
- liveRequestSettings: Setting_LiveRequest | undefined
+ liveRequestSettings: Setting_LiveRequest | undefined,
): string {
- const accountInfo = useAccount();
- const biliAuth = useBiliAuth();
+ const accountInfo = useAccount()
+ const biliAuth = useBiliAuth()
// 歌曲有特殊要求
if (song.options) {
return '点歌 | 此项目有特殊要求, 请在直播间内点歌, 点击后将复制点歌内容到剪切板'
@@ -27,10 +27,10 @@ export function getSongRequestTooltip(
}
// 主播不允许匿名点歌且用户未登录
- if (liveRequestSettings?.allowFromWeb &&
- !liveRequestSettings.allowAnonymousFromWeb &&
- !accountInfo.value.id &&
- !biliAuth.isAuthed) {
+ if (liveRequestSettings?.allowFromWeb
+ && !liveRequestSettings.allowAnonymousFromWeb
+ && !accountInfo.value.id
+ && !biliAuth.isAuthed) {
return '点歌 | 主播不允许匿名点歌, 需要从网页点歌的话请注册登录, 点击后将复制点歌内容到剪切板'
}
@@ -54,14 +54,14 @@ export function getSongRequestButtonType(
song: SongsInfo,
liveRequestSettings: Setting_LiveRequest | undefined,
isLoggedIn: boolean = true,
- isBiliAuthed: boolean = false
+ isBiliAuthed: boolean = false,
): 'warning' | 'info' {
- if (song.options ||
- liveRequestSettings?.allowFromWeb === false ||
- (liveRequestSettings?.allowFromWeb &&
- !liveRequestSettings.allowAnonymousFromWeb &&
- !isLoggedIn &&
- !isBiliAuthed)) {
+ if (song.options
+ || liveRequestSettings?.allowFromWeb === false
+ || (liveRequestSettings?.allowFromWeb
+ && !liveRequestSettings.allowAnonymousFromWeb
+ && !isLoggedIn
+ && !isBiliAuthed)) {
return 'warning'
}
@@ -84,20 +84,20 @@ export function canRequestSong(
liveRequestSettings: Setting_LiveRequest | undefined,
isLoggedIn: boolean,
isBiliAuthed: boolean = false,
- nextRequestTime?: Date
-): { canRequest: boolean; reason?: string; shouldCopyOnly?: boolean } {
+ nextRequestTime?: Date,
+): { canRequest: boolean, reason?: string, shouldCopyOnly?: boolean } {
// 检查主播信息
if (!userInfo?.id) {
return { canRequest: false, reason: '无法获取主播信息,无法完成点歌' }
}
// 判断是否应该只复制到剪贴板
- const shouldCopyOnly = song.options ||
- !liveRequestSettings?.allowFromWeb ||
- (liveRequestSettings?.allowFromWeb &&
- !liveRequestSettings.allowAnonymousFromWeb &&
- !isLoggedIn &&
- !isBiliAuthed)
+ const shouldCopyOnly = song.options
+ || !liveRequestSettings?.allowFromWeb
+ || (liveRequestSettings?.allowFromWeb
+ && !liveRequestSettings.allowAnonymousFromWeb
+ && !isLoggedIn
+ && !isBiliAuthed)
if (shouldCopyOnly) {
let reason = ''
@@ -118,7 +118,7 @@ export function canRequestSong(
const remainingSeconds = Math.ceil((nextRequestTime.getTime() - new Date().getTime()) / 1000)
return {
canRequest: false,
- reason: `距离点歌冷却还有${remainingSeconds}秒`
+ reason: `距离点歌冷却还有${remainingSeconds}秒`,
}
}
@@ -132,4 +132,4 @@ export function canRequestSong(
*/
export function getSongRequestConfirmText(song: SongsInfo): string {
return `确定要点 ${song.name} 么`
-}
\ No newline at end of file
+}
diff --git a/tsconfig.json b/tsconfig.json
index e117fa0..059bc0c 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,25 +1,26 @@
{
"compilerOptions": {
"target": "ESNext",
- "module": "ESNext",
- "strict": true,
- "moduleResolution": "Bundler",
- "skipLibCheck": true,
- "esModuleInterop": true,
- "allowSyntheticDefaultImports": true,
- "forceConsistentCasingInFileNames": true,
+ "lib": ["ESNext", "DOM", "DOM.Iterable", "ScriptHost"],
"useDefineForClassFields": true,
- "allowJs": false,
- "sourceMap": true,
"baseUrl": ".",
- "types": ["node", "vue-vine/macros", "jszip"],
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
"paths": {
"@/*": ["src/*"]
},
- "lib": ["ESNext", "DOM", "DOM.Iterable", "ScriptHost"],
"resolveJsonModule": true,
+ "types": ["node", "vue-vine/macros", "jszip"],
+ "allowJs": false,
+ "strict": true,
+ "allowSyntheticDefaultImports": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true,
+ "sourceMap": true,
"isolatedModules": true
},
+ "references": [{ "path": "./tsconfig.node.json" }],
"include": [
"src/**/*.ts",
"src/**/*.tsx",
@@ -32,6 +33,5 @@
"src/data/chat/models.js",
"src/store/useDanmakuClient.ts"
],
- "exclude": ["node_modules"],
- "references": [{ "path": "./tsconfig.node.json" }]
+ "exclude": ["node_modules"]
}
diff --git a/vite.config.mts b/vite.config.mts
index 837b08b..b9dbf9e 100644
--- a/vite.config.mts
+++ b/vite.config.mts
@@ -1,14 +1,14 @@
+import path from 'node:path'
// vite.config.ts
-import vue from '@vitejs/plugin-vue';
-import vueJsx from '@vitejs/plugin-vue-jsx';
-import path from 'path';
-import AutoImport from 'unplugin-auto-import/vite';
-import { NaiveUiResolver } from 'unplugin-vue-components/resolvers';
-import Components from 'unplugin-vue-components/vite';
-import Markdown from 'unplugin-vue-markdown/vite';
-import { defineConfig } from 'vite';
-import svgLoader from 'vite-svg-loader';
-import { VineVitePlugin } from 'vue-vine/vite';
+import vue from '@vitejs/plugin-vue'
+import vueJsx from '@vitejs/plugin-vue-jsx'
+import AutoImport from 'unplugin-auto-import/vite'
+import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
+import Components from 'unplugin-vue-components/vite'
+import Markdown from 'unplugin-vue-markdown/vite'
+import { defineConfig } from 'vite'
+import svgLoader from 'vite-svg-loader'
+import { VineVitePlugin } from 'vue-vine/vite'
// 自定义SVGO插件,删除所有名称以sodipodi:和inkscape:开头的元素
const removeSodipodiInkscape = {
@@ -21,13 +21,13 @@ const removeSodipodiInkscape = {
// 检查元素名称是否以sodipodi:或inkscape:开头
if (node.name && (node.name.startsWith('sodipodi:') || node.name.startsWith('inkscape:'))) {
// 从父节点的children数组中过滤掉当前节点
- parentNode.children = parentNode.children.filter((child: any) => child !== node);
+ parentNode.children = parentNode.children.filter((child: any) => child !== node)
}
},
},
- };
+ }
},
-};
+}
export default defineConfig({
plugins: [
@@ -37,10 +37,10 @@ export default defineConfig({
template: {
compilerOptions: {
isCustomElement: (tag) => {
- return tag.includes(':') || tag.startsWith('yt-');
- }
- }
- }
+ return tag.includes(':') || tag.startsWith('yt-')
+ },
+ },
+ },
}),
vueJsx(),
svgLoader({
@@ -51,20 +51,20 @@ export default defineConfig({
params: {
overrides: {
removeEditorsNSData: false,
- }
- }
+ },
+ },
},
removeSodipodiInkscape,
- "convertStyleToAttrs",
- "removeUselessDefs",
- "removeUselessStrokeAndFill",
- "removeUnusedNS",
- "removeEmptyText",
- "removeEmptyContainers",
- "removeViewBox",
- "cleanupIds",
- ]
- }
+ 'convertStyleToAttrs',
+ 'removeUselessDefs',
+ 'removeUselessStrokeAndFill',
+ 'removeUnusedNS',
+ 'removeEmptyText',
+ 'removeEmptyContainers',
+ 'removeViewBox',
+ 'cleanupIds',
+ ],
+ },
}),
Markdown({
/* options */
@@ -75,10 +75,10 @@ export default defineConfig({
'useDialog',
'useMessage',
'useNotification',
- 'useLoadingBar'
- ]
+ 'useLoadingBar',
+ ],
}],
- dts: 'src/auto-imports.d.ts'
+ dts: 'src/auto-imports.d.ts',
}),
Components({
resolvers: [NaiveUiResolver()],
@@ -92,11 +92,11 @@ export default defineConfig({
resolve: { alias: { '@': path.resolve(__dirname, 'src') } },
define: {
'process.env': {},
- global: 'window',
- __BUILD_TIME__: JSON.stringify(new Date().toISOString())
+ 'global': 'window',
+ '__BUILD_TIME__': JSON.stringify(new Date().toISOString()),
},
optimizeDeps: {
- include: ['@vicons/fluent', '@vicons/ionicons5', 'vue', 'vue-router']
+ include: ['@vicons/fluent', '@vicons/ionicons5', 'vue', 'vue-router'],
},
build: {
sourcemap: true,
@@ -104,12 +104,24 @@ export default defineConfig({
minify: 'esbuild',
chunkSizeWarningLimit: 1000,
rollupOptions: {
- output: {
- manualChunks: {
- 'vue-vendor': ['vue', 'vue-router', 'pinia'],
- 'ui-vendor': ['naive-ui', '@vueuse/core'],
- }
- }
- }
+ output: { // @ts-ignore
+ advancedChunks: {
+ groups: [
+ {
+ name: 'vue-vendor',
+ test: /[\\/]node_modules[\\/](vue|vue-router|pinia)[\\/]/,
+ priority: -10,
+ enforce: true,
+ },
+ {
+ name: 'ui-vendor',
+ test: /[\\/]node_modules[\\/](naive-ui|@vueuse[\\/]core)[\\/]/,
+ priority: -10,
+ enforce: true,
+ },
+ ],
+ },
+ },
+ },
},
-});
+})
|