Compare commits

..

9 Commits

Author SHA1 Message Date
b8b73ba6f2 add cn host 2025-03-18 23:33:49 +08:00
31f765277a fix hubs url 2025-03-18 22:58:19 +08:00
3d42dd1884 add allow anonymous user add liverequest 2025-03-18 22:42:18 +08:00
e0add9edbe fix url 2025-03-18 21:29:35 +08:00
e00447497b fix webfetcher iframe detect 2025-03-18 21:00:06 +08:00
e2ff1616b8 fix loading display 2025-03-18 20:54:28 +08:00
36526af71c fix action 2025-03-18 20:50:12 +08:00
a4a45bba1c try fix url construct 2025-03-18 20:48:14 +08:00
1b6ec67ba8 update build action 2025-03-18 20:42:25 +08:00
28 changed files with 382 additions and 246 deletions

View File

@@ -22,3 +22,5 @@ jobs:
run: bun install run: bun install
- name: 📦 Build - name: 📦 Build
run: bun run build run: bun run build
- name: 📦 Upload SourceMap
run: bunx @hyperdx/cli upload-sourcemaps --serviceKey ${{ secrets.HYPERDX_SERVICE_KEY }} --path dist/assets

BIN
bun.lockb

Binary file not shown.

View File

@@ -10,6 +10,7 @@
}, },
"dependencies": { "dependencies": {
"@hyperdx/browser": "^0.21.2", "@hyperdx/browser": "^0.21.2",
"@hyperdx/cli": "^0.1.0",
"@microsoft/signalr": "^8.0.7", "@microsoft/signalr": "^8.0.7",
"@microsoft/signalr-protocol-msgpack": "^8.0.7", "@microsoft/signalr-protocol-msgpack": "^8.0.7",
"@mixer/postmessage-rpc": "^1.1.4", "@mixer/postmessage-rpc": "^1.1.4",

View File

@@ -1,5 +1,5 @@
import { ExtendedDock24Filled } from "@vicons/fluent" import { ExtendedDock24Filled } from '@vicons/fluent'
import { UserConsumptionSetting } from "./models/consumption" import { UserConsumptionSetting } from './models/consumption'
export interface APIRoot<T> { export interface APIRoot<T> {
code: number code: number
@@ -13,16 +13,16 @@ export interface PaginationResponse<T> extends APIRoot<T> {
more: boolean more: boolean
} }
export enum IndexTypes { export enum IndexTypes {
Default, Default
} }
export enum SongListTypes { export enum SongListTypes {
Default, Default
} }
export enum GuardLevel { export enum GuardLevel {
None = 0, None = 0,
Zongdu = 1, Zongdu = 1,
Tidu = 2, Tidu = 2,
Jianzhang = 3, Jianzhang = 3
} }
export interface UserBasicInfo { export interface UserBasicInfo {
name: string name: string
@@ -53,7 +53,7 @@ export interface EventFetcherStateModel {
export enum EventFetcherType { export enum EventFetcherType {
Application, Application,
OBS, OBS,
Server, Server
} }
export interface AccountInfo extends UserInfo { export interface AccountInfo extends UserInfo {
isEmailVerified: boolean isEmailVerified: boolean
@@ -98,7 +98,7 @@ export enum BiliAuthCodeStatusType {
NotBind, NotBind,
Active, Active,
Notfound, Notfound,
Inactive, Inactive
} }
export interface Setting_SendEmail { export interface Setting_SendEmail {
recieveQA: boolean recieveQA: boolean
@@ -134,9 +134,7 @@ export interface Setting_Index {
allowDisplayInIndex: boolean allowDisplayInIndex: boolean
videos: string[] videos: string[]
notification: string notification: string
links: { links: { [key: string]: string }
[key: string]: string
}
} }
export interface Setting_LiveRequest { export interface Setting_LiveRequest {
orderPrefix: string orderPrefix: string
@@ -146,6 +144,7 @@ export interface Setting_LiveRequest {
queueMaxSize: number queueMaxSize: number
allowAllDanmaku: boolean allowAllDanmaku: boolean
allowFromWeb: boolean allowFromWeb: boolean
allowAnonymousFromWeb: boolean
needWearFanMedal: boolean needWearFanMedal: boolean
needJianzhang: boolean needJianzhang: boolean
needTidu: boolean needTidu: boolean
@@ -247,28 +246,28 @@ export interface Setting_QuestionDisplay {
export enum QuestionDisplayAlign { export enum QuestionDisplayAlign {
Left, Left,
Right, Right,
Center, Center
} }
export enum SettingPointGiftAllowType { export enum SettingPointGiftAllowType {
All, All,
WhiteList, WhiteList
} }
export enum KeywordMatchType { export enum KeywordMatchType {
Full, Full,
Contains, Contains,
Regex, Regex
} }
export enum QueueSortType { export enum QueueSortType {
GuardFirst, GuardFirst,
PaymentFist, PaymentFist,
TimeFirst, TimeFirst,
FansMedalFirst, FansMedalFirst
} }
export enum QueueGiftFilterType { export enum QueueGiftFilterType {
Or, Or,
And, And
} }
export enum FunctionTypes { export enum FunctionTypes {
SongList, SongList,
@@ -277,7 +276,7 @@ export enum FunctionTypes {
SongRequest, SongRequest,
Queue, Queue,
Point, Point,
VideoCollect, VideoCollect
} }
export interface SongAuthorInfo { export interface SongAuthorInfo {
name: string name: string
@@ -287,7 +286,7 @@ export enum SongFrom {
Custom, Custom,
Netease, Netease,
FiveSing, FiveSing,
Kugou, Kugou
} }
export interface SongsInfo { export interface SongsInfo {
id: number id: number
@@ -319,13 +318,13 @@ export enum SongLanguage {
Japanese, // 日文 Japanese, // 日文
Spanish, // 西班牙文 Spanish, // 西班牙文
French, // 法文 French, // 法文
Other, //其他 Other //其他
} }
export enum LevelTypes { export enum LevelTypes {
Info, Info,
Success, Success,
Warn, Warn,
Error, Error
} }
export interface NotifactionInfo { export interface NotifactionInfo {
id: string id: string
@@ -342,7 +341,7 @@ export enum ViolationTypes {
PORNOGRAPHY, PORNOGRAPHY,
POLITICS, POLITICS,
ADVERTISING, ADVERTISING,
AGGRESSION, AGGRESSION
} }
export type QAReviewInfo = { export type QAReviewInfo = {
isApproved: boolean isApproved: boolean
@@ -396,7 +395,7 @@ export interface ScheduleDayInfo {
export enum ThemeType { export enum ThemeType {
Auto = 'auto', Auto = 'auto',
Light = 'light', Light = 'light',
Dark = 'dark', Dark = 'dark'
} }
export interface VideoCollectCreateModel { export interface VideoCollectCreateModel {
id?: string id?: string
@@ -430,12 +429,12 @@ export interface VideoCollectVideo {
} }
export enum VideoFrom { export enum VideoFrom {
Collect, Collect,
Spam, Spam
} }
export enum VideoStatus { export enum VideoStatus {
Pending, Pending,
Accepted, Accepted,
Rejected, Rejected
} }
export interface VideoSender { export interface VideoSender {
sendAt: number sendAt: number
@@ -487,7 +486,7 @@ export interface OpenLiveLotteryUserInfo {
} }
export enum OpenLiveLotteryType { export enum OpenLiveLotteryType {
Waiting, Waiting,
Result, Result
} }
export interface UpdateLiveLotteryUsersModel { export interface UpdateLiveLotteryUsersModel {
users: OpenLiveLotteryUserInfo[] users: OpenLiveLotteryUserInfo[]
@@ -522,26 +521,26 @@ export enum SongRequestFrom {
Danmaku, Danmaku,
SC, SC,
Web, Web,
Gift, Gift
} }
export enum QueueFrom { export enum QueueFrom {
Manual, Manual,
Danmaku, Danmaku,
Gift, Gift,
Web, Web
} }
export enum SongRequestStatus { export enum SongRequestStatus {
Waiting, Waiting,
Singing, Singing,
Finish, Finish,
Cancel, Cancel
} }
export enum QueueStatus { export enum QueueStatus {
Waiting, Waiting,
Progressing, Progressing,
Finish, Finish,
Cancel, Cancel
} }
export interface EventModel { export interface EventModel {
type: EventDataTypes type: EventDataTypes
@@ -567,7 +566,7 @@ export enum EventDataTypes {
Message, Message,
Like, Like,
SCDel, SCDel,
Enter, Enter
} }
export interface ResponseQueueModel { export interface ResponseQueueModel {
id: number id: number
@@ -620,7 +619,7 @@ export enum FeedbackType {
Opinion, Opinion,
Bug, Bug,
FunctionRequest, FunctionRequest,
Other, Other
} }
export enum FeedbackStatus { export enum FeedbackStatus {
Padding, Padding,
@@ -628,7 +627,7 @@ export enum FeedbackStatus {
Finish, Finish,
Todo, Todo,
Reject, Reject,
Developing, Developing
} }
export interface TagInfo { export interface TagInfo {
name: string name: string
@@ -637,11 +636,11 @@ export interface TagInfo {
export enum GoodsStatus { export enum GoodsStatus {
Normal, // 商品正常 Normal, // 商品正常
//OutOfStock, // 商品无货 //OutOfStock, // 商品无货
Discontinued, // 商品下架 Discontinued // 商品下架
} }
export enum GoodsTypes { export enum GoodsTypes {
Physical, Physical,
Virtual, Virtual
} }
export interface PointGoodsSetting { export interface PointGoodsSetting {
guardFree?: { year: number; month: number } guardFree?: { year: number; month: number }
@@ -757,7 +756,7 @@ export interface ResponsePointOrder2UserModel {
export enum PointOrderStatus { export enum PointOrderStatus {
Pending, // 订单正在等待处理 Pending, // 订单正在等待处理
Shipped, // 订单已发货 Shipped, // 订单已发货
Completed, // 订单已完成 Completed // 订单已完成
} }
export interface ResponsePointHisrotyModel { export interface ResponsePointHisrotyModel {
point: number point: number
@@ -773,13 +772,11 @@ export interface ResponsePointHisrotyModel {
export enum PointFrom { export enum PointFrom {
Danmaku, Danmaku,
Manual, Manual,
Use, Use
} }
export interface ResponseUserIndexModel { export interface ResponseUserIndexModel {
notification: string notification: string
videos: VideoCollectVideo[] videos: VideoCollectVideo[]
links: { links: { [key: string]: string }
[key: string]: string
}
} }

View File

@@ -25,6 +25,7 @@ export async function QueryPostAPIWithParams<T>(
contentType?: string, contentType?: string,
headers?: [string, string][] headers?: [string, string][]
): Promise<APIRoot<T>> { ): Promise<APIRoot<T>> {
// @ts-expect-error 忽略
return await QueryPostAPIWithParamsInternal<APIRoot<T>>( return await QueryPostAPIWithParamsInternal<APIRoot<T>>(
urlString, urlString,
params, params,
@@ -40,15 +41,23 @@ async function QueryPostAPIWithParamsInternal<T>(
contentType: string = 'application/json', contentType: string = 'application/json',
headers: [string, string][] = [] headers: [string, string][] = []
) { ) {
const url = new URL(urlString) let url: URL
try {
url = new URL(urlString.toString())
} catch (e) {
console.error('尝试解析API地址失败: ' + urlString, e)
return {
code: 400,
message: '无效的API地址: ' + urlString,
data: {} as T
}
}
url.search = getParams(params) url.search = getParams(params)
headers ??= [] headers ??= []
let h = {} as { let h = {} as { [key: string]: string }
[key: string]: string headers.forEach((header) => {
}
headers.forEach(header => {
h[header[0]] = header[1] h[header[0]] = header[1]
}); })
if (cookie.value) h['Authorization'] = `Bearer ${cookie.value}` if (cookie.value) h['Authorization'] = `Bearer ${cookie.value}`
h['Content-Type'] = contentType h['Content-Type'] = contentType
@@ -77,6 +86,7 @@ export async function QueryGetAPI<T>(
params?: any, params?: any,
headers?: [string, string][] headers?: [string, string][]
): Promise<APIRoot<T>> { ): Promise<APIRoot<T>> {
// @ts-expect-error 忽略
return await QueryGetAPIInternal<APIRoot<T>>(urlString, params, headers) return await QueryGetAPIInternal<APIRoot<T>>(urlString, params, headers)
} }
async function QueryGetAPIInternal<T>( async function QueryGetAPIInternal<T>(
@@ -85,22 +95,27 @@ async function QueryGetAPIInternal<T>(
headers?: [string, string][] headers?: [string, string][]
) { ) {
try { try {
const url = new URL(urlString) let url: URL
try {
url = new URL(urlString.toString())
} catch (e) {
console.error('尝试解析API地址失败: ' + urlString, e)
return {
code: 400,
message: '无效的API地址: ' + urlString,
data: {} as T
}
}
url.search = getParams(params) url.search = getParams(params)
headers ??= [] headers ??= []
let h = {} as { let h = {} as { [key: string]: string }
[key: string]: string
}
headers.forEach((header) => { headers.forEach((header) => {
h[header[0]] = header[1] h[header[0]] = header[1]
}) })
if (cookie.value) { if (cookie.value) {
h['Authorization'] = `Bearer ${cookie.value}` h['Authorization'] = `Bearer ${cookie.value}`
} }
return await QueryAPIInternal<T>(url, { return await QueryAPIInternal<T>(url, { method: 'get', headers: h })
method: 'get',
headers: h
})
} catch (err) { } catch (err) {
console.log(`url:${urlString}, error:${err}`) console.log(`url:${urlString}, error:${err}`)
throw err throw err
@@ -133,6 +148,7 @@ export async function QueryPostPaginationAPI<T>(
url: string, url: string,
body?: unknown body?: unknown
): Promise<PaginationResponse<T>> { ): Promise<PaginationResponse<T>> {
// @ts-expect-error 忽略
return await QueryPostAPIWithParamsInternal<PaginationResponse<T>>( return await QueryPostAPIWithParamsInternal<PaginationResponse<T>>(
url, url,
undefined, undefined,
@@ -143,6 +159,7 @@ export async function QueryGetPaginationAPI<T>(
urlString: string, urlString: string,
params?: unknown params?: unknown
): Promise<PaginationResponse<T>> { ): Promise<PaginationResponse<T>> {
// @ts-expect-error 忽略
return await QueryGetAPIInternal<PaginationResponse<T>>(urlString, params) return await QueryGetAPIInternal<PaginationResponse<T>>(urlString, params)
} }
export function GetHeaders(): [string, string][] { export function GetHeaders(): [string, string][] {

View File

@@ -2,7 +2,9 @@ import DefaultIndexTemplateVue from '@/views/view/indexTemplate/DefaultIndexTemp
import { defineAsyncComponent, ref } from 'vue' import { defineAsyncComponent, ref } from 'vue'
const debugAPI = const debugAPI =
import.meta.env.VITE_API == 'dev' ? import.meta.env.VITE_DEBUG_DEV_API : import.meta.env.VITE_DEBUG_RELEASE_API import.meta.env.VITE_API == 'dev'
? import.meta.env.VITE_DEBUG_DEV_API
: import.meta.env.VITE_DEBUG_RELEASE_API
const releseAPI = `https://vtsuru.suki.club/` const releseAPI = `https://vtsuru.suki.club/`
const failoverAPI = `https://failover-api.vtsuru.suki.club/` const failoverAPI = `https://failover-api.vtsuru.suki.club/`
@@ -15,68 +17,85 @@ export const THINGS_URL = FILE_BASE_URL + '/things/'
export const apiFail = ref(false) export const apiFail = ref(false)
export const BASE_URL = { export const BASE_URL = {
toString: () => (process.env.NODE_ENV === 'development' ? debugAPI : apiFail.value ? failoverAPI : releseAPI),
}
export const BASE_API_URL = {
toString: () => BASE_URL + 'api/',
}
export const FETCH_API = 'https://fetch.vtsuru.live/'
export const BASE_HUB_URL = {
toString: () => toString: () =>
(process.env.NODE_ENV === 'development' ? debugAPI : apiFail.value ? failoverAPI : releseAPI) + 'hub/', process.env.NODE_ENV === 'development'
? debugAPI
: apiFail.value
? failoverAPI
: releseAPI
} }
export const BASE_API_URL = BASE_URL.toString() + 'api/'
export const FETCH_API = 'https://fetch.vtsuru.live/'
export const BASE_HUB_URL =
(process.env.NODE_ENV === 'development'
? debugAPI
: apiFail.value
? failoverAPI
: releseAPI) + 'hub/'
export const TURNSTILE_KEY = '0x4AAAAAAAETUSAKbds019h0' export const TURNSTILE_KEY = '0x4AAAAAAAETUSAKbds019h0'
export const CURRENT_HOST = `${window.location.protocol}//${window.location.host}/` export const CURRENT_HOST = `${window.location.protocol}//${window.location.host}/`
export const CN_HOST = 'https://cn.vtsuru.suki.club/'
export const USER_API_URL = { toString: () => `${BASE_API_URL}user/` } export const USER_API_URL = BASE_API_URL + 'user/'
export const ACCOUNT_API_URL = { toString: () => `${BASE_API_URL}account/` } export const ACCOUNT_API_URL = BASE_API_URL + 'account/'
export const BILI_API_URL = { toString: () => `${BASE_API_URL}bili/` } export const BILI_API_URL = BASE_API_URL + 'bili/'
export const SONG_API_URL = { toString: () => `${BASE_API_URL}song-list/` } export const SONG_API_URL = BASE_API_URL + 'song-list/'
export const NOTIFACTION_API_URL = { toString: () => `${BASE_API_URL}notifaction/` } export const NOTIFACTION_API_URL = BASE_API_URL + 'notification/'
export const QUESTION_API_URL = { toString: () => `${BASE_API_URL}qa/` } export const QUESTION_API_URL = BASE_API_URL + 'qa/'
export const LOTTERY_API_URL = { toString: () => `${BASE_API_URL}lottery/` } export const LOTTERY_API_URL = BASE_API_URL + 'lottery/'
export const HISTORY_API_URL = { toString: () => `${BASE_API_URL}history/` } export const HISTORY_API_URL = BASE_API_URL + 'history/'
export const SCHEDULE_API_URL = { toString: () => `${BASE_API_URL}schedule/` } export const SCHEDULE_API_URL = BASE_API_URL + 'schedule/'
export const VIDEO_COLLECT_API_URL = { toString: () => `${BASE_API_URL}video-collect/` } export const VIDEO_COLLECT_API_URL = BASE_API_URL + 'video-collect/'
export const OPEN_LIVE_API_URL = { toString: () => `${BASE_API_URL}open-live/` } export const OPEN_LIVE_API_URL = BASE_API_URL + 'open-live/'
export const SONG_REQUEST_API_URL = { toString: () => `${BASE_API_URL}live-request/` } export const SONG_REQUEST_API_URL = BASE_API_URL + 'live-request/'
export const QUEUE_API_URL = { toString: () => `${BASE_API_URL}queue/` } export const QUEUE_API_URL = BASE_API_URL + 'queue/'
export const EVENT_API_URL = { toString: () => `${BASE_API_URL}event/` } export const EVENT_API_URL = BASE_API_URL + 'event/'
export const LIVE_API_URL = { toString: () => `${BASE_API_URL}live/` } export const LIVE_API_URL = BASE_API_URL + 'live/'
export const FEEDBACK_API_URL = { toString: () => `${BASE_API_URL}feedback/` } export const FEEDBACK_API_URL = BASE_API_URL + 'feedback/'
export const MUSIC_REQUEST_API_URL = { toString: () => `${BASE_API_URL}music-request/` } export const MUSIC_REQUEST_API_URL = BASE_API_URL + 'music-request/'
export const VTSURU_API_URL = { toString: () => `${BASE_API_URL}vtsuru/` } export const VTSURU_API_URL = BASE_API_URL + 'vtsuru/'
export const POINT_API_URL = { toString: () => `${BASE_API_URL}point/` } export const POINT_API_URL = BASE_API_URL + 'point/'
export const BILI_AUTH_API_URL = { toString: () => `${BASE_API_URL}bili-auth/` } export const BILI_AUTH_API_URL = BASE_API_URL + 'bili-auth/'
export const FORUM_API_URL = { toString: () => `${BASE_API_URL}forum/` } export const FORUM_API_URL = BASE_API_URL + 'forum/'
export const USER_INDEX_API_URL = { toString: () => `${BASE_API_URL}user-index/` } export const USER_INDEX_API_URL = BASE_API_URL + 'user-index/'
export const ScheduleTemplateMap = { export const ScheduleTemplateMap = {
'': { '': {
name: '默认', name: '默认',
compoent: defineAsyncComponent(() => import('@/views/view/scheduleTemplate/DefaultScheduleTemplate.vue')), compoent: defineAsyncComponent(
() => import('@/views/view/scheduleTemplate/DefaultScheduleTemplate.vue')
)
}, },
pinky: { pinky: {
name: '粉粉', name: '粉粉',
compoent: defineAsyncComponent(() => import('@/views/view/scheduleTemplate/PinkySchedule.vue')), compoent: defineAsyncComponent(
}, () => import('@/views/view/scheduleTemplate/PinkySchedule.vue')
)
}
} as { [key: string]: { name: string; compoent: any } } } as { [key: string]: { name: string; compoent: any } }
export const SongListTemplateMap = { export const SongListTemplateMap = {
'': { '': {
name: '默认', name: '默认',
compoent: defineAsyncComponent(() => import('@/views/view/songListTemplate/DefaultSongListTemplate.vue')), compoent: defineAsyncComponent(
() => import('@/views/view/songListTemplate/DefaultSongListTemplate.vue')
)
}, },
simple: { simple: {
name: '简单', name: '简单',
compoent: defineAsyncComponent(() => import('@/views/view/songListTemplate/SimpleSongListTemplate.vue')), compoent: defineAsyncComponent(
() => import('@/views/view/songListTemplate/SimpleSongListTemplate.vue')
)
}, },
traditional: { traditional: {
name: '传统', name: '传统',
compoent: defineAsyncComponent(() => import('@/views/view/songListTemplate/TraditionalSongListTemplate.vue')), compoent: defineAsyncComponent(
}, () =>
import('@/views/view/songListTemplate/TraditionalSongListTemplate.vue')
)
}
} as { [key: string]: { name: string; compoent: any } } } as { [key: string]: { name: string; compoent: any } }
export const IndexTemplateMap = { export const IndexTemplateMap = {
'': { name: '默认', compoent: DefaultIndexTemplateVue }, '': { name: '默认', compoent: DefaultIndexTemplateVue }
} as { [key: string]: { name: string; compoent: any } } } as { [key: string]: { name: string; compoent: any } }

View File

@@ -96,13 +96,15 @@ QueryGetAPI<string>(BASE_API_URL + 'vtsuru/version')
console.log('默认API调用失败, 切换至故障转移节点') console.log('默认API调用失败, 切换至故障转移节点')
}) })
.finally(async () => { .finally(async () => {
HyperDX.init({ if (process.env.NODE_ENV !== 'development') {
apiKey: '7d1eb66c-24b8-445e-a406-dc2329fa9423', HyperDX.init({
service: 'vtsuru.live', apiKey: '7d1eb66c-24b8-445e-a406-dc2329fa9423',
tracePropagationTargets: [/vtsuru.suki.club/i], // Set to link traces from frontend to backend requests service: 'vtsuru.live',
consoleCapture: true, // Capture console logs (default false) tracePropagationTargets: [/vtsuru.suki.club/i], // Set to link traces from frontend to backend requests
advancedNetworkCapture: true // Capture full HTTP request/response headers and bodies (default false) consoleCapture: true, // Capture console logs (default false)
}) advancedNetworkCapture: true // Capture full HTTP request/response headers and bodies (default false)
})
}
//加载其他数据 //加载其他数据
InitTTS() InitTTS()
await GetSelfAccount() await GetSelfAccount()

View File

@@ -4,9 +4,7 @@ import {
MasterRTCClient, MasterRTCClient,
SlaveRTCClient SlaveRTCClient
} from '@/data/RTCClient' } from '@/data/RTCClient'
import { Router24Regular } from '@vicons/fluent'
import { useStorage } from '@vueuse/core' import { useStorage } from '@vueuse/core'
import { nonFunctionArgSeparator } from 'html2canvas/dist/types/css/syntax/parser'
import { acceptHMRUpdate, defineStore } from 'pinia' import { acceptHMRUpdate, defineStore } from 'pinia'
import { ref } from 'vue' import { ref } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'

View File

@@ -35,6 +35,8 @@ import { NButton, NCard, NDivider, NLayoutContent, NSpace, NText, NTimeline, NTi
height="200" frameborder="0"></iframe> height="200" frameborder="0"></iframe>
<NDivider title-placement="left"> 更新日志 </NDivider> <NDivider title-placement="left"> 更新日志 </NDivider>
<NTimeline> <NTimeline>
<NTimelineItem type="info" title="功能添加" content="点歌允许从网页匿名点歌" time="2025-3-18" />
<NTimelineItem type="success" title="功能添加" content="棉花糖添加内容审查功能" time="2025-3-2" />
<NTimelineItem type="info" title="功能更新" content="允许棉花糖设置页滚动条进度同步到obs组件" time="2024-11-23" /> <NTimelineItem type="info" title="功能更新" content="允许棉花糖设置页滚动条进度同步到obs组件" time="2024-11-23" />
<NTimelineItem type="info" title="功能更新" content="礼物兑换允许上舰用户免费兑换, 以及仅允许上舰用户兑换" time="2024-4-23" /> <NTimelineItem type="info" title="功能更新" content="礼物兑换允许上舰用户免费兑换, 以及仅允许上舰用户兑换" time="2024-4-23" />
<NTimelineItem type="info" title="功能更新" content="积分订单添加导出功能, 允许删除积分用户" time="2024-3-22" /> <NTimelineItem type="info" title="功能更新" content="积分订单添加导出功能, 允许删除积分用户" time="2024-3-22" />

View File

@@ -611,7 +611,7 @@ onMounted(() => {
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
padding: 50px; padding: 50px;
height: 100%; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
"> ">
<template v-if="!isLoadingAccount"> <template v-if="!isLoadingAccount">

View File

@@ -3,7 +3,7 @@ import { useAccount } from '@/api/account'
import { BiliAuthCodeStatusType, BiliAuthModel } from '@/api/api-models' import { BiliAuthCodeStatusType, BiliAuthModel } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue' import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import { ACCOUNT_API_URL, TURNSTILE_KEY } from '@/data/constants' import { ACCOUNT_API_URL, CN_HOST, TURNSTILE_KEY } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore' import { useAuthStore } from '@/store/useAuthStore'
import { Info24Filled, Mic24Filled, Question24Regular } from '@vicons/fluent' import { Info24Filled, Mic24Filled, Question24Regular } from '@vicons/fluent'
import { useLocalStorage } from '@vueuse/core' import { useLocalStorage } from '@vueuse/core'
@@ -286,8 +286,13 @@ onUnmounted(() => {
</script> </script>
<template> <template>
<NFlex justify="center" align="center" vertical> <NAlert type="success" style="width: 100%; ">
<NTabs type="segment" animated v-if="accountInfo" style="width: 100%;" :default-value="$route.query.tab?.toString() ?? 'info'"> 本站新增国内镜像: {{ CN_HOST }}, 访问更快
</NAlert>
<NDivider />
<NFlex justify="center" align="center" vertical style="margin: 0 auto; max-width: 1500px;">
<NTabs type="segment" animated v-if="accountInfo" style="width: 100%;"
:default-value="$route.query.tab?.toString() ?? 'info'">
<NTabPane name="info" tab="个人信息" style="width: 100%;" display-directive="show:lazy"> <NTabPane name="info" tab="个人信息" style="width: 100%;" display-directive="show:lazy">
<NFlex justify="center" align="center"> <NFlex justify="center" align="center">
<NCard embedded style="width: 100%;max-width: 800px;"> <NCard embedded style="width: 100%;max-width: 800px;">

View File

@@ -2,7 +2,7 @@
import { copyToClipboard, downloadImage } from '@/Utils' import { copyToClipboard, downloadImage } from '@/Utils'
import { DisableFunction, EnableFunction, SaveSetting, useAccount } from '@/api/account' import { DisableFunction, EnableFunction, SaveSetting, useAccount } from '@/api/account'
import { FunctionTypes, QAInfo, Setting_QuestionDisplay } from '@/api/api-models' import { FunctionTypes, QAInfo, Setting_QuestionDisplay } from '@/api/api-models'
import { CURRENT_HOST } from '@/data/constants' import { CN_HOST, CURRENT_HOST } from '@/data/constants'
import router from '@/router' import router from '@/router'
import { Heart, HeartOutline, TrashBin } from '@vicons/ionicons5' import { Heart, HeartOutline, TrashBin } from '@vicons/ionicons5'
import QuestionItem from '@/components/QuestionItem.vue' import QuestionItem from '@/components/QuestionItem.vue'
@@ -62,6 +62,8 @@ const shareModalVisiable = ref(false)
const replyMessage = ref() const replyMessage = ref()
const addTagName = ref('') const addTagName = ref('')
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const showSettingCard = ref(true) const showSettingCard = ref(true)
const showOBSModal = ref(false) const showOBSModal = ref(false)
const defaultSettings = {} as Setting_QuestionDisplay const defaultSettings = {} as Setting_QuestionDisplay
@@ -81,6 +83,7 @@ const setting = computed({
const shareCardRef = ref() const shareCardRef = ref()
const shareUrl = computed(() => `${CURRENT_HOST}@` + accountInfo.value?.name + '/question-box') const shareUrl = computed(() => `${CURRENT_HOST}@` + accountInfo.value?.name + '/question-box')
const shareUrlCN = computed(() => CN_HOST + accountInfo.value?.name + '/question-box')
const ps = ref(20) const ps = ref(20)
const pn = ref(1) const pn = ref(1)
@@ -239,6 +242,17 @@ onMounted(() => {
</NTooltip> </NTooltip>
</NAlert> </NAlert>
</NSpace> </NSpace>
<NDivider style="margin: 16px 0 16px 0" title-placement="left">
提问页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/question-box`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/question-box`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider style="margin: 10px 0 10px 0" /> <NDivider style="margin: 10px 0 10px 0" />
<template v-if="useQB.reviewing > 0"> <template v-if="useQB.reviewing > 0">
<NAlert type="warning" title="有提问正在审核中"> <NAlert type="warning" title="有提问正在审核中">
@@ -506,9 +520,14 @@ onMounted(() => {
</div> </div>
<NDivider style="margin: 10px" /> <NDivider style="margin: 10px" />
<NInputGroup> <NInputGroup>
<NInput :value="shareUrl" /> <NInput :value="shareUrl" readonly/>
<NButton secondary @click="copyToClipboard(shareUrl)"> 复制 </NButton> <NButton secondary @click="copyToClipboard(shareUrl)"> 复制 </NButton>
</NInputGroup> </NInputGroup>
<NDivider style="margin: 10px"> 国内镜像 (访问更快) </NDivider>
<NInputGroup>
<NInput :value="shareUrlCN" readonly />
<NButton secondary @click="copyToClipboard(shareUrlCN)"> 复制 </NButton>
</NInputGroup>
<br /><br /> <br /><br />
<NSpace justify="center"> <NSpace justify="center">
<NButton type="primary" @click="saveShareImage"> 保存卡片 </NButton> <NButton type="primary" @click="saveShareImage"> 保存卡片 </NButton>

View File

@@ -3,14 +3,18 @@ import { DisableFunction, EnableFunction, useAccount } from '@/api/account'
import { FunctionTypes, ScheduleWeekInfo } from '@/api/api-models' import { FunctionTypes, ScheduleWeekInfo } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import ScheduleList from '@/components/ScheduleList.vue' import ScheduleList from '@/components/ScheduleList.vue'
import { SCHEDULE_API_URL } from '@/data/constants' import { CN_HOST, CURRENT_HOST, SCHEDULE_API_URL } from '@/data/constants'
import { copyToClipboard } from '@/Utils'
import { useStorage } from '@vueuse/core'
import { addWeeks, endOfWeek, endOfYear, format, isBefore, startOfWeek, startOfYear } from 'date-fns' import { addWeeks, endOfWeek, endOfYear, format, isBefore, startOfWeek, startOfYear } from 'date-fns'
import { import {
NAlert, NAlert,
NBadge, NBadge,
NButton, NButton,
NCheckbox,
NColorPicker, NColorPicker,
NDivider, NDivider,
NFlex,
NInput, NInput,
NInputGroup, NInputGroup,
NInputGroupLabel, NInputGroupLabel,
@@ -130,6 +134,8 @@ const showCopyModal = ref(false)
const updateScheduleModel = ref<ScheduleWeekInfo>({} as ScheduleWeekInfo) const updateScheduleModel = ref<ScheduleWeekInfo>({} as ScheduleWeekInfo)
const selectedExistTag = ref() const selectedExistTag = ref()
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const selectedDay = ref(0) const selectedDay = ref(0)
const selectedScheduleYear = ref(new Date().getFullYear()) const selectedScheduleYear = ref(new Date().getFullYear())
const selectedScheduleWeek = ref(Number(format(Date.now(), 'w')) + 1) const selectedScheduleWeek = ref(Number(format(Date.now(), 'w')) + 1)
@@ -277,7 +283,17 @@ onMounted(() => {
<NButton @click="$router.push({ name: 'manage-index', query: { tab: 'template', template: 'schedule' } })"> <NButton @click="$router.push({ name: 'manage-index', query: { tab: 'template', template: 'schedule' } })">
修改模板 修改模板
</NButton> </NButton>
</NSpace> </NSpace><NDivider style="margin: 16px 0 16px 0" title-placement="left">
日程表展示页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/schedule`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/schedule`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider /> <NDivider />
<NModal v-model:show="showAddModal" style="width: 600px; max-width: 90vw" preset="card" title="添加周程"> <NModal v-model:show="showAddModal" style="width: 600px; max-width: 90vw" preset="card" title="添加周程">
<NSpace vertical> <NSpace vertical>

View File

@@ -1,12 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { objectsToCSV } from '@/Utils' import { copyToClipboard, objectsToCSV } from '@/Utils'
import { DisableFunction, EnableFunction, useAccount } from '@/api/account' import { DisableFunction, EnableFunction, useAccount } from '@/api/account'
import { FunctionTypes, SongFrom, SongLanguage, SongRequestOption, SongsInfo } from '@/api/api-models' import { FunctionTypes, SongFrom, SongLanguage, SongRequestOption, SongsInfo } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import SongList from '@/components/SongList.vue' import SongList from '@/components/SongList.vue'
import { FETCH_API, SONG_API_URL } from '@/data/constants' import { CN_HOST, CURRENT_HOST, FETCH_API, SONG_API_URL } from '@/data/constants'
import { Info24Filled } from '@vicons/fluent' import { Info24Filled } from '@vicons/fluent'
import { ArchiveOutline } from '@vicons/ionicons5' import { ArchiveOutline } from '@vicons/ionicons5'
import { useStorage } from '@vueuse/core'
import { format } from 'date-fns' import { format } from 'date-fns'
// @ts-ignore // @ts-ignore
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
@@ -58,6 +59,8 @@ const neteaseIdInput = ref()
const fivesingSearchInput = ref() const fivesingSearchInput = ref()
const isModalLoading = ref(false) const isModalLoading = ref(false)
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const onlyResetNameOnAdded = ref(true) const onlyResetNameOnAdded = ref(true)
const neteaseSongListId = computed(() => { const neteaseSongListId = computed(() => {
@@ -600,15 +603,15 @@ onMounted(async () => {
</NAlert> </NAlert>
<NButton @click="showModal = true" type="primary"> 添加歌曲 </NButton> <NButton @click="showModal = true" type="primary"> 添加歌曲 </NButton>
<NButton @click="exportData" type="primary" secondary> 导出为 CSV </NButton> <NButton @click="exportData" type="primary" secondary> 导出为 CSV </NButton>
<NButton @click="$router.push({ name: 'manage-liveRequest' })" secondary> 前往点 </NButton> <NButton @click="$router.push({ name: 'manage-liveRequest' })" secondary> 前往点播管理 </NButton>
<NButton @click="$router.push({ name: 'user-songList', params: { id: accountInfo?.name } })" secondary> <NButton @click="$router.push({ name: 'user-songList', params: { id: accountInfo?.name } })" secondary>
前往展示页 前往歌单展示页
</NButton> </NButton>
<NButton :loading="isLoading" @click="() => { <NButton :loading="isLoading" @click="() => {
getSongs() getSongs()
message.success('完成') message.success('完成')
} }
"> ">
刷新 刷新
</NButton> </NButton>
<NButton <NButton
@@ -616,6 +619,17 @@ onMounted(async () => {
修改模板 修改模板
</NButton> </NButton>
</NSpace> </NSpace>
<NDivider style="margin: 16px 0 16px 0" title-placement="left">
歌单展示页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/song-list`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/song-list`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider style="margin: 16px 0 16px 0" /> <NDivider style="margin: 16px 0 16px 0" />
<NModal v-model:show="showModal" style="max-width: 1000px" preset="card" :key="showModalRenderKey"> <NModal v-model:show="showModal" style="max-width: 1000px" preset="card" :key="showModalRenderKey">
<template #header> 添加歌曲 </template> <template #header> 添加歌曲 </template>
@@ -659,15 +673,15 @@ onMounted(async () => {
</template> </template>
<NSpace vertical> <NSpace vertical>
<NCheckbox :checked="addSongModel.options != undefined" @update:checked="(checked: boolean) => { <NCheckbox :checked="addSongModel.options != undefined" @update:checked="(checked: boolean) => {
addSongModel.options = checked addSongModel.options = checked
? ({ ? ({
needJianzhang: false, needJianzhang: false,
needTidu: false, needTidu: false,
needZongdu: false, needZongdu: false,
} as SongRequestOption) } as SongRequestOption)
: undefined : undefined
} }
"> ">
是否启用 是否启用
</NCheckbox> </NCheckbox>
<template v-if="addSongModel.options != undefined"> <template v-if="addSongModel.options != undefined">
@@ -678,9 +692,9 @@ onMounted(async () => {
</NSpace> </NSpace>
<NSpace align="center"> <NSpace align="center">
<NCheckbox :checked="addSongModel.options.scMinPrice != undefined" @update:checked="(checked: boolean) => { <NCheckbox :checked="addSongModel.options.scMinPrice != undefined" @update:checked="(checked: boolean) => {
if (addSongModel.options) addSongModel.options.scMinPrice = checked ? 30 : undefined if (addSongModel.options) addSongModel.options.scMinPrice = checked ? 30 : undefined
} }
"> ">
需要SC 需要SC
</NCheckbox> </NCheckbox>
<NInputGroup v-if="addSongModel.options?.scMinPrice" style="width: 200px"> <NInputGroup v-if="addSongModel.options?.scMinPrice" style="width: 200px">
@@ -690,9 +704,9 @@ onMounted(async () => {
</NSpace> </NSpace>
<NSpace align="center"> <NSpace align="center">
<NCheckbox :checked="addSongModel.options.fanMedalMinLevel != undefined" @update:checked="(checked: boolean) => { <NCheckbox :checked="addSongModel.options.fanMedalMinLevel != undefined" @update:checked="(checked: boolean) => {
if (addSongModel.options) addSongModel.options.fanMedalMinLevel = checked ? 5 : undefined if (addSongModel.options) addSongModel.options.fanMedalMinLevel = checked ? 5 : undefined
} }
"> ">
需要粉丝牌 需要粉丝牌
<NTooltip> <NTooltip>
<template #trigger> <template #trigger>

View File

@@ -1,11 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { getImageUploadModel } from '@/Utils' import { copyToClipboard, getImageUploadModel } from '@/Utils'
import { DisableFunction, EnableFunction, useAccount } from '@/api/account' import { DisableFunction, EnableFunction, useAccount } from '@/api/account'
import { FunctionTypes, GoodsStatus, GoodsTypes, PointGoodsModel, ResponsePointGoodModel } from '@/api/api-models' import { FunctionTypes, GoodsStatus, GoodsTypes, PointGoodsModel, ResponsePointGoodModel } from '@/api/api-models'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue' import EventFetcherStatusCard from '@/components/EventFetcherStatusCard.vue'
import PointGoodsItem from '@/components/manage/PointGoodsItem.vue' import PointGoodsItem from '@/components/manage/PointGoodsItem.vue'
import { FILE_BASE_URL, POINT_API_URL } from '@/data/constants' import { CN_HOST, CURRENT_HOST, FILE_BASE_URL, POINT_API_URL } from '@/data/constants'
import { useAuthStore } from '@/store/useAuthStore' import { useAuthStore } from '@/store/useAuthStore'
import { Info24Filled } from '@vicons/fluent' import { Info24Filled } from '@vicons/fluent'
import { useRouteHash } from '@vueuse/router' import { useRouteHash } from '@vueuse/router'
@@ -25,6 +25,7 @@ import {
NImage, NImage,
NInput, NInput,
NInputNumber, NInputNumber,
NInputGroup,
NModal, NModal,
NPopconfirm, NPopconfirm,
NRadioButton, NRadioButton,
@@ -45,6 +46,7 @@ import { computed, onMounted, ref } from 'vue'
import PointOrderManage from './PointOrderManage.vue' import PointOrderManage from './PointOrderManage.vue'
import PointSettings from './PointSettings.vue' import PointSettings from './PointSettings.vue'
import PointUserManage from './PointUserManage.vue' import PointUserManage from './PointUserManage.vue'
import { useStorage } from '@vueuse/core'
const message = useMessage() const message = useMessage()
const accountInfo = useAccount() const accountInfo = useAccount()
@@ -83,6 +85,8 @@ const showAddGoodsModal = ref(false)
const isAllowedPrivacyPolicy = ref(false) const isAllowedPrivacyPolicy = ref(false)
const isUpdating = ref(false) const isUpdating = ref(false)
const useCNUrl = useStorage('Settings.UseCNUrl', false)
const allowedYearOptions = computed(() => { const allowedYearOptions = computed(() => {
//从2024到现在的年份 //从2024到现在的年份
return Array.from({ length: new Date().getFullYear() - 2024 + 1 }, (_, i) => 2024 + i).map((item) => { return Array.from({ length: new Date().getFullYear() - 2024 + 1 }, (_, i) => 2024 + i).map((item) => {
@@ -377,6 +381,17 @@ onMounted(() => { })
</NAlert> </NAlert>
<EventFetcherStatusCard /> <EventFetcherStatusCard />
</NFlex> </NFlex>
<NDivider style="margin: 16px 0 16px 0" title-placement="left">
礼物展示页链接
</NDivider>
<NFlex align="center">
<NInputGroup style="max-width: 400px;">
<NInput :value="`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/point`" readonly />
<NButton secondary @click="copyToClipboard(`${useCNUrl ? CN_HOST : CURRENT_HOST}@${accountInfo.name}/point`)">
复制 </NButton>
</NInputGroup>
<NCheckbox v-model:checked="useCNUrl"> 使用国内镜像(访问更快) </NCheckbox>
</NFlex>
<NDivider /> <NDivider />
<NTabs animated v-model:value="hash"> <NTabs animated v-model:value="hash">
<NTabPane name="goods" tab="礼物"> <NTabPane name="goods" tab="礼物">

View File

@@ -47,8 +47,8 @@ defineExpose({ setCss })
const { customCss, isOBS = true } = defineProps<{ const { customCss, isOBS = true } = defineProps<{
customCss?: string customCss?: string
isOBS?: boolean, isOBS?: boolean,
active: boolean, active?: boolean,
visible: boolean, visible?: boolean,
}>() }>()
const messageRender = ref() const messageRender = ref()

View File

@@ -88,8 +88,13 @@ async function get() {
if (data.code == 200) { if (data.code == 200) {
return data.data return data.data
} }
} catch (err) {} } catch (err) {
return {} as { songs: SongRequestInfo[]; setting: Setting_LiveRequest } console.log(err)
}
return {
songs: [],
setting: {} as Setting_LiveRequest,
} as { songs: SongRequestInfo[]; setting: Setting_LiveRequest }
} }
const allowGuardTypes = computed(() => { const allowGuardTypes = computed(() => {
const types = [] const types = []
@@ -148,19 +153,12 @@ onUnmounted(() => {
<NDivider class="live-request-divider"> <NDivider class="live-request-divider">
<p class="live-request-header-count">已有 {{ activeSongs.length ?? 0 }} </p> <p class="live-request-header-count">已有 {{ activeSongs.length ?? 0 }} </p>
</NDivider> </NDivider>
<div <div class="live-request-processing-container"
class="live-request-processing-container" :singing="songs.findIndex((s) => s.status == SongRequestStatus.Singing) > -1" :from="singing?.from as number"
:singing="songs.findIndex((s) => s.status == SongRequestStatus.Singing) > -1" :status="singing?.status as number">
:from="singing?.from as number"
:status="singing?.status as number"
>
<div class="live-request-processing-prefix"></div> <div class="live-request-processing-prefix"></div>
<template v-if="singing"> <template v-if="singing">
<img <img class="live-request-processing-avatar" :src="singing?.user?.face" referrerpolicy="no-referrer" />
class="live-request-processing-avatar"
:src="singing?.user?.face"
referrerpolicy="no-referrer"
/>
<p class="live-request-processing-song-name">{{ singing?.songName }}</p> <p class="live-request-processing-song-name">{{ singing?.songName }}</p>
<p class="live-request-processing-name">{{ singing?.user?.name }}</p> <p class="live-request-processing-name">{{ singing?.user?.name }}</p>
</template> </template>
@@ -169,22 +167,10 @@ onUnmounted(() => {
</div> </div>
<div class="live-request-content" ref="listContainerRef"> <div class="live-request-content" ref="listContainerRef">
<template v-if="activeSongs.length > 0"> <template v-if="activeSongs.length > 0">
<Vue3Marquee <Vue3Marquee class="live-request-list" :key="key" vertical :duration="20" :pause="!isMoreThanContainer"
class="live-request-list" :style="`height: ${height}px;width: ${width}px;`">
:key="key" <div class="live-request-list-item" :from="song.from as number" :status="song.status as number"
vertical v-for="(song, index) in activeSongs" :key="song.id" :style="`height: ${itemHeight}px`">
:duration="20"
:pause="!isMoreThanContainer"
:style="`height: ${height}px;width: ${width}px;`"
>
<div
class="live-request-list-item"
:from="song.from as number"
:status="song.status as number"
v-for="(song, index) in activeSongs"
:key="song.id"
:style="`height: ${itemHeight}px`"
>
<div class="live-request-list-item-index" :index="index + 1"> <div class="live-request-list-item-index" :index="index + 1">
{{ index + 1 }} {{ index + 1 }}
</div> </div>
@@ -194,11 +180,8 @@ onUnmounted(() => {
<p v-if="settings.showUserName" class="live-request-list-item-name"> <p v-if="settings.showUserName" class="live-request-list-item-name">
{{ song.from == SongRequestFrom.Manual ? '主播添加' : song.user?.name }} {{ song.from == SongRequestFrom.Manual ? '主播添加' : song.user?.name }}
</p> </p>
<div <div v-if="settings.showFanMadelInfo" class="live-request-list-item-level"
v-if="settings.showFanMadelInfo" :has-level="(song.user?.fans_medal_level ?? 0) > 0">
class="live-request-list-item-level"
:has-level="(song.user?.fans_medal_level ?? 0) > 0"
>
{{ `${song.user?.fans_medal_name} ${song.user?.fans_medal_level}` }} {{ `${song.user?.fans_medal_name} ${song.user?.fans_medal_level}` }}
</div> </div>
</div> </div>
@@ -210,13 +193,8 @@ onUnmounted(() => {
</div> </div>
</div> </div>
<div class="live-request-footer" v-if="settings.showRequireInfo" ref="footerRef"> <div class="live-request-footer" v-if="settings.showRequireInfo" ref="footerRef">
<Vue3Marquee <Vue3Marquee :key="key" ref="footerListRef" class="live-request-footer-marquee" :duration="10"
:key="key" animate-on-overflow-only>
ref="footerListRef"
class="live-request-footer-marquee"
:duration="10"
animate-on-overflow-only
>
<span class="live-request-tag" type="prefix"> <span class="live-request-tag" type="prefix">
<div class="live-request-tag-key">前缀</div> <div class="live-request-tag-key">前缀</div>
<div class="live-request-tag-value"> <div class="live-request-tag-value">
@@ -264,6 +242,7 @@ onUnmounted(() => {
border-radius: 10px; border-radius: 10px;
color: white; color: white;
} }
.live-request-header { .live-request-header {
margin: 0; margin: 0;
color: #fff; color: #fff;
@@ -276,17 +255,20 @@ onUnmounted(() => {
0 0 30px #61606086, 0 0 30px #61606086,
0 0 40px rgba(64, 156, 179, 0.555); 0 0 40px rgba(64, 156, 179, 0.555);
} }
.live-request-header-count { .live-request-header-count {
color: #ffffffbd; color: #ffffffbd;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
} }
.live-request-divider { .live-request-divider {
margin: 0 auto; margin: 0 auto;
margin-top: -15px; margin-top: -15px;
margin-bottom: -15px; margin-bottom: -15px;
width: 90%; width: 90%;
} }
.live-request-processing-container { .live-request-processing-container {
height: 35px; height: 35px;
margin: 0 10px 0 10px; margin: 0 10px 0 10px;
@@ -294,34 +276,41 @@ onUnmounted(() => {
align-items: center; align-items: center;
gap: 10px; gap: 10px;
} }
.live-request-processing-empty { .live-request-processing-empty {
font-weight: bold; font-weight: bold;
font-style: italic; font-style: italic;
color: #ffffffbe; color: #ffffffbe;
} }
.live-request-processing-prefix { .live-request-processing-prefix {
border: 2px solid rgb(231, 231, 231); border: 2px solid rgb(231, 231, 231);
height: 30px; height: 30px;
width: 10px; width: 10px;
border-radius: 10px; border-radius: 10px;
} }
.live-request-processing-container[singing='true'] .live-request-processing-prefix { .live-request-processing-container[singing='true'] .live-request-processing-prefix {
background-color: #75c37f; background-color: #75c37f;
animation: animated-border 3s linear infinite; animation: animated-border 3s linear infinite;
} }
.live-request-processing-container[singing='false'] .live-request-processing-prefix { .live-request-processing-container[singing='false'] .live-request-processing-prefix {
background-color: #c37575; background-color: #c37575;
} }
.live-request-processing-avatar { .live-request-processing-avatar {
height: 30px; height: 30px;
border-radius: 50%; border-radius: 50%;
/* 添加无限旋转动画 */ /* 添加无限旋转动画 */
animation: rotate 20s linear infinite; animation: rotate 20s linear infinite;
} }
/* 网页点歌 */ /* 网页点歌 */
.live-request-processing-container[from='3'] .live-request-processing-avatar { .live-request-processing-container[from='3'] .live-request-processing-avatar {
display: none; display: none;
} }
.live-request-processing-song-name { .live-request-processing-song-name {
font-size: large; font-size: large;
font-weight: bold; font-weight: bold;
@@ -329,21 +318,26 @@ onUnmounted(() => {
white-space: nowrap; white-space: nowrap;
max-width: 80%; max-width: 80%;
} }
.live-request-processing-name { .live-request-processing-name {
font-size: 12px; font-size: 12px;
font-style: italic; font-style: italic;
} }
@keyframes rotate { @keyframes rotate {
0% { 0% {
transform: rotate(0); transform: rotate(0);
} }
100% { 100% {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.n-divider__line { .n-divider__line {
background-color: #ffffffd5; background-color: #ffffffd5;
} }
.live-request-content { .live-request-content {
background-color: #0f0f0f4f; background-color: #0f0f0f4f;
margin: 10px; margin: 10px;
@@ -352,9 +346,11 @@ onUnmounted(() => {
border-radius: 10px; border-radius: 10px;
overflow-x: hidden; overflow-x: hidden;
} }
.marquee { .marquee {
justify-items: left; justify-items: left;
} }
.live-request-list-item { .live-request-list-item {
display: flex; display: flex;
width: 100%; width: 100%;
@@ -364,6 +360,7 @@ onUnmounted(() => {
justify-content: left; justify-content: left;
gap: 10px; gap: 10px;
} }
.live-request-list-item-song-name { .live-request-list-item-song-name {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
@@ -380,13 +377,13 @@ onUnmounted(() => {
color: #d2d8d6; color: #d2d8d6;
font-size: 12px; font-size: 12px;
} }
.live-request-list-item[from='0'] .live-request-list-item-avatar { .live-request-list-item[from='0'] .live-request-list-item-avatar {
display: none; display: none;
} }
/* 弹幕点歌 */ /* 弹幕点歌 */
.live-request-list-item[from='1'] { .live-request-list-item[from='1'] {}
}
.live-request-list-item-name { .live-request-list-item-name {
font-style: italic; font-style: italic;
@@ -397,6 +394,7 @@ onUnmounted(() => {
margin-left: auto; margin-left: auto;
} }
.live-request-list-item-index { .live-request-list-item-index {
text-align: center; text-align: center;
height: 18px; height: 18px;
@@ -407,6 +405,7 @@ onUnmounted(() => {
color: rgba(204, 204, 204, 0.993); color: rgba(204, 204, 204, 0.993);
font-size: 12px; font-size: 12px;
} }
.live-request-list-item-level { .live-request-list-item-level {
text-align: center; text-align: center;
height: 18px; height: 18px;
@@ -417,9 +416,11 @@ onUnmounted(() => {
color: rgba(204, 204, 204, 0.993); color: rgba(204, 204, 204, 0.993);
font-size: 12px; font-size: 12px;
} }
.live-request-list-item-level[has-level='false'] { .live-request-list-item-level[has-level='false'] {
display: none; display: none;
} }
.live-request-footer { .live-request-footer {
margin: 0 5px 5px 5px; margin: 0 5px 5px 5px;
height: 60px; height: 60px;
@@ -428,6 +429,7 @@ onUnmounted(() => {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.live-request-tag { .live-request-tag {
display: flex; display: flex;
margin: 5px 0 5px 5px; margin: 5px 0 5px 5px;
@@ -440,30 +442,36 @@ onUnmounted(() => {
flex-direction: column; flex-direction: column;
justify-content: left; justify-content: left;
} }
.live-request-tag-key { .live-request-tag-key {
font-style: italic; font-style: italic;
color: rgb(211, 211, 211); color: rgb(211, 211, 211);
font-size: 12px; font-size: 12px;
} }
.live-request-tag-value { .live-request-tag-value {
font-size: 14px; font-size: 14px;
} }
.live-request-list-item-index[index='1'] { .live-request-list-item-index[index='1'] {
background-color: #ebc34c; background-color: #ebc34c;
color: white; color: white;
font-weight: bold; font-weight: bold;
text-shadow: 0 0 6px #ebc34c; text-shadow: 0 0 6px #ebc34c;
} }
.live-request-list-item-index[index='2'] { .live-request-list-item-index[index='2'] {
background-color: #c0c0c0; background-color: #c0c0c0;
color: white; color: white;
font-weight: bold; font-weight: bold;
} }
.live-request-list-item-index[index='3'] { .live-request-list-item-index[index='3'] {
background-color: #b87333; background-color: #b87333;
color: white; color: white;
font-weight: bold; font-weight: bold;
} }
@keyframes animated-border { @keyframes animated-border {
0% { 0% {
box-shadow: 0 0 0px #589580; box-shadow: 0 0 0px #589580;

View File

@@ -16,8 +16,8 @@ import { Vue3Marquee } from 'vue3-marquee'
const props = defineProps<{ const props = defineProps<{
id?: number, id?: number,
active: boolean, active?: boolean,
visible: boolean, visible?: boolean,
}>() }>()
const message = useMessage() const message = useMessage()

View File

@@ -16,8 +16,8 @@ type WaitMusicInfo = {
const props = defineProps<{ const props = defineProps<{
id?: number, id?: number,
active: boolean, active?: boolean,
visible: boolean, visible?: boolean,
}>() }>()
const message = useMessage() const message = useMessage()
@@ -52,7 +52,7 @@ async function get() {
if (data.code == 200) { if (data.code == 200) {
return data.data return data.data
} }
} catch (err) {} } catch (err) { }
return originSongs.value return originSongs.value
} }
const isMoreThanContainer = computed(() => { const isMoreThanContainer = computed(() => {
@@ -85,18 +85,13 @@ onUnmounted(() => {
<NDivider class="music-request-divider"> <NDivider class="music-request-divider">
<p class="music-request-header-count">已有 {{ originSongs.waiting.length ?? 0 }} </p> <p class="music-request-header-count">已有 {{ originSongs.waiting.length ?? 0 }} </p>
</NDivider> </NDivider>
<div <div class="music-request-singing-container" :playing="originSongs.playing ? 'true' : 'false'"
class="music-request-singing-container" :from="originSongs.playing?.music.from ?? -1">
:playing="originSongs.playing ? 'true' : 'false'"
:from="originSongs.playing?.music.from ?? -1"
>
<div class="music-request-singing-prefix"></div> <div class="music-request-singing-prefix"></div>
<template v-if="originSongs.playing"> <template v-if="originSongs.playing">
<img <img class="music-request-singing-avatar"
class="music-request-singing-avatar"
:src="originSongs.playing.music.cover ?? AVATAR_URL + originSongs.playing.from?.uid" :src="originSongs.playing.music.cover ?? AVATAR_URL + originSongs.playing.from?.uid"
referrerpolicy="no-referrer" referrerpolicy="no-referrer" />
/>
<p class="music-request-singing-song-name">{{ originSongs.playing.music.name }}</p> <p class="music-request-singing-song-name">{{ originSongs.playing.music.name }}</p>
<p class="music-request-singing-name">{{ originSongs.playing.from?.name }}</p> <p class="music-request-singing-name">{{ originSongs.playing.from?.name }}</p>
</template> </template>
@@ -105,21 +100,10 @@ onUnmounted(() => {
</div> </div>
<div class="music-request-content" ref="listContainerRef"> <div class="music-request-content" ref="listContainerRef">
<template v-if="originSongs.waiting.length > 0"> <template v-if="originSongs.waiting.length > 0">
<Vue3Marquee <Vue3Marquee class="music-request-list" :key="key" vertical :pause="!isMoreThanContainer" :duration="20"
class="music-request-list" :style="`height: ${height}px;width: ${width}px;`">
:key="key" <span class="music-request-list-item" :from="item.music.from as number"
vertical v-for="(item, index) in originSongs.waiting" :key="item.music.id" :style="`height: ${itemHeight}px`">
:pause="!isMoreThanContainer"
:duration="20"
:style="`height: ${height}px;width: ${width}px;`"
>
<span
class="music-request-list-item"
:from="item.music.from as number"
v-for="(item, index) in originSongs.waiting"
:key="item.music.id"
:style="`height: ${itemHeight}px`"
>
<div class="music-request-list-item-index" :index="index + 1"> <div class="music-request-list-item-index" :index="index + 1">
{{ index + 1 }} {{ index + 1 }}
</div> </div>
@@ -149,6 +133,7 @@ onUnmounted(() => {
border-radius: 10px; border-radius: 10px;
color: white; color: white;
} }
.music-request-header { .music-request-header {
margin: 0; margin: 0;
color: #fff; color: #fff;
@@ -161,17 +146,20 @@ onUnmounted(() => {
0 0 30px #61606086, 0 0 30px #61606086,
0 0 40px rgba(64, 156, 179, 0.555); 0 0 40px rgba(64, 156, 179, 0.555);
} }
.music-request-header-count { .music-request-header-count {
color: #ffffffbd; color: #ffffffbd;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
} }
.music-request-divider { .music-request-divider {
margin: 0 auto; margin: 0 auto;
margin-top: -15px; margin-top: -15px;
margin-bottom: -15px; margin-bottom: -15px;
width: 90%; width: 90%;
} }
.music-request-singing-container { .music-request-singing-container {
height: 35px; height: 35px;
margin: 0 10px 0 10px; margin: 0 10px 0 10px;
@@ -179,34 +167,41 @@ onUnmounted(() => {
align-items: center; align-items: center;
gap: 10px; gap: 10px;
} }
.music-request-singing-empty { .music-request-singing-empty {
font-weight: bold; font-weight: bold;
font-style: italic; font-style: italic;
color: #ffffffbe; color: #ffffffbe;
} }
.music-request-singing-prefix { .music-request-singing-prefix {
border: 2px solid rgb(231, 231, 231); border: 2px solid rgb(231, 231, 231);
height: 30px; height: 30px;
width: 10px; width: 10px;
border-radius: 10px; border-radius: 10px;
} }
.music-request-singing-container[playing='true'] .music-request-singing-prefix { .music-request-singing-container[playing='true'] .music-request-singing-prefix {
background-color: #75c37f; background-color: #75c37f;
animation: animated-border 3s linear infinite; animation: animated-border 3s linear infinite;
} }
.music-request-singing-container[playing='false'] .music-request-singing-prefix { .music-request-singing-container[playing='false'] .music-request-singing-prefix {
background-color: #c37575; background-color: #c37575;
} }
.music-request-singing-avatar { .music-request-singing-avatar {
height: 30px; height: 30px;
border-radius: 50%; border-radius: 50%;
/* 添加无限旋转动画 */ /* 添加无限旋转动画 */
animation: rotate 20s linear infinite; animation: rotate 20s linear infinite;
} }
/* 网页点歌 */ /* 网页点歌 */
.music-request-singing-container[from='3'] .music-request-singing-avatar { .music-request-singing-container[from='3'] .music-request-singing-avatar {
display: none; display: none;
} }
.music-request-singing-song-name { .music-request-singing-song-name {
font-size: large; font-size: large;
font-weight: bold; font-weight: bold;
@@ -214,21 +209,26 @@ onUnmounted(() => {
white-space: nowrap; white-space: nowrap;
max-width: 80%; max-width: 80%;
} }
.music-request-singing-name { .music-request-singing-name {
font-size: 12px; font-size: 12px;
font-style: italic; font-style: italic;
} }
@keyframes rotate { @keyframes rotate {
0% { 0% {
transform: rotate(0); transform: rotate(0);
} }
100% { 100% {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.n-divider__line { .n-divider__line {
background-color: #ffffffd5; background-color: #ffffffd5;
} }
.music-request-content { .music-request-content {
background-color: #0f0f0f4f; background-color: #0f0f0f4f;
margin: 10px; margin: 10px;
@@ -237,9 +237,11 @@ onUnmounted(() => {
border-radius: 10px; border-radius: 10px;
overflow-x: hidden; overflow-x: hidden;
} }
.marquee { .marquee {
justify-items: left; justify-items: left;
} }
.music-request-list-item { .music-request-list-item {
display: flex; display: flex;
width: 100%; width: 100%;
@@ -249,6 +251,7 @@ onUnmounted(() => {
justify-content: left; justify-content: left;
gap: 10px; gap: 10px;
} }
.music-request-list-item-song-name { .music-request-list-item-song-name {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
@@ -265,13 +268,13 @@ onUnmounted(() => {
color: #d2d8d6; color: #d2d8d6;
font-size: 12px; font-size: 12px;
} }
.music-request-list-item[from='0'] .music-request-list-item-avatar { .music-request-list-item[from='0'] .music-request-list-item-avatar {
display: none; display: none;
} }
/* 弹幕点歌 */ /* 弹幕点歌 */
.music-request-list-item[from='1'] { .music-request-list-item[from='1'] {}
}
.music-request-list-item-name { .music-request-list-item-name {
font-style: italic; font-style: italic;
@@ -282,6 +285,7 @@ onUnmounted(() => {
margin-left: auto; margin-left: auto;
} }
.music-request-list-item-index { .music-request-list-item-index {
text-align: center; text-align: center;
height: 18px; height: 18px;
@@ -292,6 +296,7 @@ onUnmounted(() => {
color: rgba(204, 204, 204, 0.993); color: rgba(204, 204, 204, 0.993);
font-size: 12px; font-size: 12px;
} }
.music-request-list-item-level { .music-request-list-item-level {
text-align: center; text-align: center;
height: 18px; height: 18px;
@@ -302,9 +307,11 @@ onUnmounted(() => {
color: rgba(204, 204, 204, 0.993); color: rgba(204, 204, 204, 0.993);
font-size: 12px; font-size: 12px;
} }
.music-request-list-item-level[has-level='false'] { .music-request-list-item-level[has-level='false'] {
display: none; display: none;
} }
.music-request-tag { .music-request-tag {
display: flex; display: flex;
margin: 5px 0 5px 5px; margin: 5px 0 5px 5px;
@@ -317,14 +324,17 @@ onUnmounted(() => {
flex-direction: column; flex-direction: column;
justify-content: left; justify-content: left;
} }
.music-request-tag-key { .music-request-tag-key {
font-style: italic; font-style: italic;
color: rgb(211, 211, 211); color: rgb(211, 211, 211);
font-size: 12px; font-size: 12px;
} }
.music-request-tag-value { .music-request-tag-value {
font-size: 14px; font-size: 14px;
} }
@keyframes animated-border { @keyframes animated-border {
0% { 0% {
box-shadow: 0 0 0px #589580; box-shadow: 0 0 0px #589580;

View File

@@ -9,8 +9,8 @@ import { useWebRTC } from '@/store/useRTC'
const props = defineProps<{ const props = defineProps<{
id?: number, id?: number,
active: boolean, active?: boolean,
visible: boolean, visible?: boolean,
}>() }>()
const hash = ref('') const hash = ref('')

View File

@@ -20,8 +20,8 @@ import { Vue3Marquee } from 'vue3-marquee'
const props = defineProps<{ const props = defineProps<{
id?: number, id?: number,
active: boolean, active?: boolean,
visible: boolean, visible?: boolean,
}>() }>()
const message = useMessage() const message = useMessage()

View File

@@ -20,7 +20,7 @@ function onGetDanmaku(data: any) {
let timer: any let timer: any
onMounted(async () => { onMounted(async () => {
if (window.parent) { //当是客户端组件时不自动启动, 需要客户端来启动以获取启动响应 if (window.frameElement) { //当是客户端组件时不自动启动, 需要客户端来启动以获取启动响应
console.log('[web-fetcher-iframe] 当前为客户端组件') console.log('[web-fetcher-iframe] 当前为客户端组件')
rpc = new RPC({ rpc = new RPC({

View File

@@ -1203,6 +1203,10 @@ onUnmounted(() => {
:disabled="!configCanEdit"> :disabled="!configCanEdit">
允许通过网页点歌 允许通过网页点歌
</NCheckbox> </NCheckbox>
<NCheckbox v-if="settings.allowFromWeb" v-model:checked="settings.allowAnonymousFromWeb" @update:checked="updateSettings"
:disabled="!configCanEdit">
允许匿名通过网页点歌
</NCheckbox>
</NSpace> </NSpace>
<NDivider> 冷却 (单位: 秒) </NDivider> <NDivider> 冷却 (单位: 秒) </NDivider>
<NCheckbox v-model:checked="settings.enableCooldown" @update:checked="updateSettings" <NCheckbox v-model:checked="settings.enableCooldown" @update:checked="updateSettings"

View File

@@ -283,7 +283,15 @@ function speakFromAPI(text: string) {
.trim() .trim()
.replace(/^(?:https?:\/\/)/, '') .replace(/^(?:https?:\/\/)/, '')
.replace(/\{\{\s*text\s*\}\}/, encodeURIComponent(text))}` .replace(/\{\{\s*text\s*\}\}/, encodeURIComponent(text))}`
const tempURL = new URL(url) let tempURL: URL
try {
tempURL = new URL(url)
} catch (err) {
console.log(err)
message.error('无效的API地址: ' + url)
cancelSpeech()
return
}
if (isVtsuruVoiceAPI.value) { if (isVtsuruVoiceAPI.value) {
tempURL.searchParams.set('vtsuruId', accountInfo.value?.id.toString() ?? '-1') tempURL.searchParams.set('vtsuruId', accountInfo.value?.id.toString() ?? '-1')
url = tempURL.toString() url = tempURL.toString()
@@ -844,9 +852,9 @@ onUnmounted(() => {
<NDivider> 设置 </NDivider> <NDivider> 设置 </NDivider>
<NSpace align="center"> <NSpace align="center">
<NCheckbox :checked="settings.combineGiftDelay != undefined" @update:checked="(checked: boolean) => { <NCheckbox :checked="settings.combineGiftDelay != undefined" @update:checked="(checked: boolean) => {
settings.combineGiftDelay = checked ? 2 : undefined settings.combineGiftDelay = checked ? 2 : undefined
} }
"> ">
是否启用礼物合并 是否启用礼物合并
<NTooltip> <NTooltip>
<template #trigger> <template #trigger>
@@ -860,9 +868,9 @@ onUnmounted(() => {
<NInputGroup v-if="settings.combineGiftDelay" style="width: 200px"> <NInputGroup v-if="settings.combineGiftDelay" style="width: 200px">
<NInputGroupLabel> 送礼间隔 () </NInputGroupLabel> <NInputGroupLabel> 送礼间隔 () </NInputGroupLabel>
<NInputNumber v-model:value="settings.combineGiftDelay" @update:value="(value) => { <NInputNumber v-model:value="settings.combineGiftDelay" @update:value="(value) => {
if (!value || value <= 0) settings.combineGiftDelay = undefined if (!value || value <= 0) settings.combineGiftDelay = undefined
} }
" /> " />
</NInputGroup> </NInputGroup>
<NCheckbox v-model:checked="settings.splitText"> <NCheckbox v-model:checked="settings.splitText">
启用句子拆分 启用句子拆分

View File

@@ -12,10 +12,15 @@ import { Setting_LiveRequest, SongRequestInfo, SongsInfo, UserInfo } from '@/api
import { QueryGetAPI, QueryPostAPIWithParams } from '@/api/query' import { QueryGetAPI, QueryPostAPIWithParams } from '@/api/query'
import { TemplateConfig } from '@/data/VTsuruTypes' import { TemplateConfig } from '@/data/VTsuruTypes'
import { SONG_API_URL, SONG_REQUEST_API_URL, SongListTemplateMap, VTSURU_API_URL } from '@/data/constants' import { SONG_API_URL, SONG_REQUEST_API_URL, SongListTemplateMap, VTSURU_API_URL } from '@/data/constants'
import { useStorage } from '@vueuse/core'
import { addSeconds } from 'date-fns'
import { NSpin, useMessage } from 'naive-ui' import { NSpin, useMessage } from 'naive-ui'
import { computed, onMounted, ref, watch, watchEffect } from 'vue' import { computed, onMounted, ref, watch, watchEffect } from 'vue'
const accountInfo = useAccount() const accountInfo = useAccount()
const nextRequestTime = useStorage('SongList.NextRequestTime', new Date())
const minRequestTime = 30
const props = defineProps<{ const props = defineProps<{
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -104,15 +109,22 @@ async function getConfig() {
}) })
} }
async function requestSong(song: SongsInfo) { async function requestSong(song: SongsInfo) {
if (song.options || !settings.value.allowFromWeb) { if (song.options || !settings.value.allowFromWeb || (settings.value.allowFromWeb && !settings.value.allowAnonymousFromWeb)) {
navigator.clipboard.writeText(`${settings.value.orderPrefix} ${song.name}`) navigator.clipboard.writeText(`${settings.value.orderPrefix} ${song.name}`)
if (!accountInfo.value) { if (!settings.value.allowAnonymousFromWeb) {
message.warning('主播不允许匿名点歌, 需要从网页点歌的话请注册登录, 点歌弹幕已复制到剪切板')
}
else if (!accountInfo.value.id) {
message.warning('要从网页点歌请先登录, 点歌弹幕已复制到剪切板') message.warning('要从网页点歌请先登录, 点歌弹幕已复制到剪切板')
} else { } else {
message.success('复制成功') message.success('复制成功')
} }
} else { } else {
if (props.userInfo) { if (props.userInfo) {
if (!accountInfo.value.id && nextRequestTime.value > new Date()) {
message.warning('距离点歌冷却还有' + (nextRequestTime.value.getTime() - new Date().getTime()) / 1000 + '秒')
return
}
try { try {
const data = await QueryPostAPIWithParams(SONG_REQUEST_API_URL + 'add-from-web', { const data = await QueryPostAPIWithParams(SONG_REQUEST_API_URL + 'add-from-web', {
target: props.userInfo?.id, target: props.userInfo?.id,
@@ -121,6 +133,7 @@ async function requestSong(song: SongsInfo) {
if (data.code == 200) { if (data.code == 200) {
message.success('点歌成功') message.success('点歌成功')
nextRequestTime.value = addSeconds(new Date(), minRequestTime)
} else { } else {
message.error('点歌失败: ' + data.message) message.error('点歌失败: ' + data.message)
} }

View File

@@ -127,8 +127,7 @@ function loadMore() {
}) })
" placeholder="选择歌手" clearable /> " placeholder="选择歌手" clearable />
<NDivider /> <NDivider />
<LiveRequestOBS v-if="userInfo?.extra?.enableFunctions.includes(FunctionTypes.SongRequest)" <LiveRequestOBS v-if="userInfo?.extra?.enableFunctions.includes(FunctionTypes.SongRequest)" />
:id="userInfo?.id" />
</NSpace> </NSpace>
</NCard> </NCard>
<NEmpty v-if="!data || songs?.length == 0" description="暂无曲目" style="max-width: 0 auto" /> <NEmpty v-if="!data || songs?.length == 0" description="暂无曲目" style="max-width: 0 auto" />

View File

@@ -10,7 +10,7 @@
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"useDefineForClassFields": true, "useDefineForClassFields": true,
"allowJs": false, "allowJs": false,
"sourceMap": false, "sourceMap": true,
"baseUrl": ".", "baseUrl": ".",
"types": ["node"], "types": ["node"],
"paths": { "paths": {

View File

@@ -23,15 +23,10 @@ const monacoEditorPlugin = isObjectWithDefaultFunction(monacoEditorPluginModule)
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
vue({ vue({
script: { script: { propsDestructure: true, defineModel: true },
propsDestructure: true,
defineModel: true
},
include: [/\.vue$/, /\.md$/], include: [/\.vue$/, /\.md$/],
template: { template: {
compilerOptions: { compilerOptions: { isCustomElement: (tag) => tag.startsWith('yt-') }
isCustomElement: (tag) => tag.startsWith('yt-')
}
} }
}), }),
svgLoader(), svgLoader(),
@@ -42,19 +37,11 @@ export default defineConfig({
caddyTls(), caddyTls(),
monacoEditorPlugin({ languageWorkers: ['css'] }) monacoEditorPlugin({ languageWorkers: ['css'] })
], ],
server: { server: { port: 51000 },
port: 51000 resolve: { alias: { '@': path.resolve(__dirname, 'src') } },
}, define: { 'process.env': {}, global: 'window' },
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
define: {
'process.env': {},
global: 'window'
},
optimizeDeps: { optimizeDeps: {
include: ['@vicons/fluent', '@vicons/ionicons5', 'vue', 'vue-router'] include: ['@vicons/fluent', '@vicons/ionicons5', 'vue', 'vue-router']
} },
build: { sourcemap: true }
}) })