From 1dbbc45ee54960a826b1125a807c40ab5e0e328a Mon Sep 17 00:00:00 2001 From: Megghy Date: Sun, 19 Nov 2023 18:31:32 +0800 Subject: [PATCH] Revert "add song request" This reverts commit cb03299a994a4c460ceb50d6dbeb0eba0308239e. --- index.html | 4 +- src/api/account.ts | 8 +- src/api/api-models.ts | 81 +- src/data/DanmakuClient.ts | 1 - src/data/constants.ts | 2 - src/data/notifactions.ts | 4 +- src/router/index.ts | 8 - src/views/IndexView.vue | 1 + src/views/OpenLiveLayout.vue | 22 +- src/views/manage/SettingsManageView.vue | 8 +- src/views/obs/SongRequestOBS.vue | 323 -------- src/views/open_live/MusicRequest.vue | 953 +----------------------- src/views/open_live/OpenLottery.vue | 363 +++++---- vite.config.ts | 7 +- yarn.lock | 372 ++++----- 15 files changed, 419 insertions(+), 1738 deletions(-) delete mode 100644 src/views/obs/SongRequestOBS.vue diff --git a/index.html b/index.html index ccec625..f6e5246 100644 --- a/index.html +++ b/index.html @@ -6,9 +6,7 @@ vtsuru.live - - - + diff --git a/src/api/account.ts b/src/api/account.ts index 3af0163..6680014 100644 --- a/src/api/account.ts +++ b/src/api/account.ts @@ -1,5 +1,5 @@ import { ACCOUNT_API_URL, BASE_API } from '@/data/constants' -import { APIRoot, AccountInfo, FunctionTypes } from './api-models' +import { APIRoot, AccountInfo } from './api-models' import { QueryPostAPI } from '@/api/query' import { ref } from 'vue' import { useLocalStorage } from '@vueuse/core' @@ -47,12 +47,6 @@ function refreshCookie() { } }) } -export async function SaveAccountSettings() { - return await QueryPostAPI(ACCOUNT_API_URL + 'update-setting', ACCOUNT.value?.settings) -} -export async function SaveEnableFunctions(functions: FunctionTypes[]) { - return await QueryPostAPI(ACCOUNT_API_URL + 'update-enable-functions', functions) -} export function useAccount() { return ACCOUNT } diff --git a/src/api/api-models.ts b/src/api/api-models.ts index 1930a4e..32e56de 100644 --- a/src/api/api-models.ts +++ b/src/api/api-models.ts @@ -60,39 +60,16 @@ export interface Setting_QuestionBox { export interface UserSetting { sendEmail: Setting_SendEmail questionBox: Setting_QuestionBox - songRequest: Setting_SongRequest enableFunctions: FunctionTypes[] - indexTemplate: string | null + indexTemplate: string | null, songListTemplate: string | null scheduleTemplate: string | null } -export interface Setting_SongRequest { - orderPrefix: string - onlyAllowSongList: boolean - queueMaxSize: number - allowAllDanmaku: boolean - allowFromWeb: boolean - needWearFanMedal: boolean - needJianzhang: boolean - needTidu: boolean - needZongdu: boolean - allowSC: boolean - scIgnoreLimit: boolean - scMinPrice: number - fanMedalMinLevel: number - allowReorderSong: boolean - enableCooldown: boolean - cooldownSecond: number - zongduCooldownSecond: number - tiduCooldownSecond: number - jianzhangCooldownSecond: number -} export enum FunctionTypes { SongList, QuestionBox, Schedule, - SongRequest, } export interface SongAuthorInfo { name: string @@ -190,7 +167,7 @@ export interface VideoCollectCreateModel { endAt: number maxVideoCount: number } -export interface VideoCollectTable { +export interface VideoCollectTable{ id: string shortId: string name: string @@ -213,16 +190,17 @@ export interface VideoCollectVideo { length: number watched?: boolean } -export enum VideoFrom { +export enum VideoFrom{ Collect, - Spam, + Spam } -export enum VideoStatus { - Pending, - Accepted, - Rejected, +export enum VideoStatus +{ + Pending, + Accepted, + Rejected, } -export interface VideoSender { +export interface VideoSender{ sendAt: number sender?: string senderId?: number @@ -269,9 +247,9 @@ export interface OpenLiveLotteryUserInfo { fans_medal_wearing_status: boolean //该房间粉丝勋章佩戴情况 guard_level: number } -export enum OpenLiveLotteryType { +export enum OpenLiveLotteryType{ Waiting, - Result, + Result } export interface UpdateLiveLotteryUsersModel { users: OpenLiveLotteryUserInfo[] @@ -279,7 +257,6 @@ export interface UpdateLiveLotteryUsersModel { type: OpenLiveLotteryType } export interface SongRequestInfo { - id: number songName: string song?: SongsInfo status: SongRequestStatus @@ -287,16 +264,14 @@ export interface SongRequestInfo { scPrice?: number user?: SongRequestUserInfo createAt: number - finishAt?:number - isInLocal?: boolean } export interface SongRequestUserInfo { name: string - uid: number - guard_level: number - fans_medal_level: number - fans_medal_name: string - fans_medal_wearing_status: boolean + uId: number + guardLevel: number + fansMedalLevel: number + fansMedalName: string + fansMedalWearingStatus: boolean } export enum SongRequestFrom { @@ -311,24 +286,4 @@ export enum SongRequestStatus { Singing, Finish, Cancel, -} -export interface EventModel { - type: EventDataTypes - name: string - avatar: string - uid: number - msg: string - time: number - num: number - price: number - guard_level: number - fans_medal_level: number - fans_medal_name: string - fans_medal_wearing_status: boolean -} -export enum EventDataTypes { - Guard, - SC, - Gift, - Message, -} +} \ No newline at end of file diff --git a/src/data/DanmakuClient.ts b/src/data/DanmakuClient.ts index 76e3d0f..645e3fe 100644 --- a/src/data/DanmakuClient.ts +++ b/src/data/DanmakuClient.ts @@ -245,7 +245,6 @@ export default class DanmakuClient { chatClient.start() console.log('[OPEN-LIVE] 已连接房间: ' + auth.anchor_info.room_id) this.roomAuthInfo.value = auth - this.client = chatClient return true } else { console.log('[OPEN-LIVE] 无法开启场次') diff --git a/src/data/constants.ts b/src/data/constants.ts index 1a5027f..e541e04 100644 --- a/src/data/constants.ts +++ b/src/data/constants.ts @@ -23,8 +23,6 @@ export const HISTORY_API_URL = `${BASE_API}history/` export const SCHEDULE_API_URL = `${BASE_API}schedule/` export const VIDEO_COLLECT_API_URL = `${BASE_API}video-collect/` export const OPEN_LIVE_API_URL = `${BASE_API}open-live/` -export const SONG_REQUEST_API_URL = `${BASE_API}song-request/` -export const EVENT_API_URL = `${BASE_API}event/` export const ScheduleTemplateMap = { '': { name: '默认', compoent: defineAsyncComponent(() => import('@/views/view/scheduleTemplate/DefaultScheduleTemplate.vue')) }, diff --git a/src/data/notifactions.ts b/src/data/notifactions.ts index 21eba69..4f36b45 100644 --- a/src/data/notifactions.ts +++ b/src/data/notifactions.ts @@ -1,6 +1,6 @@ import { QueryGetAPI } from '@/api/query' import { useRequest } from 'vue-request' -import { NOTIFACTION_API_URL, SONG_REQUEST_API_URL, isBackendUsable } from './constants' +import { NOTIFACTION_API_URL, isBackendUsable } from './constants' import { NotifactionInfo } from '@/api/api-models' import { useAccount } from '@/api/account' import { ref } from 'vue' @@ -10,7 +10,7 @@ const n = ref() let isLoading = false function get() { if (isLoading) return - QueryGetAPI(SONG_REQUEST_API_URL + 'get-active') + QueryGetAPI(NOTIFACTION_API_URL + 'get') .then((data) => { if (data.code == 200) { n.value = data.data diff --git a/src/router/index.ts b/src/router/index.ts index 7f2a089..3366ef9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -233,14 +233,6 @@ const routes: Array = [ title: '直播抽奖', }, }, - { - path: 'song-request', - name: 'obs-song-request', - component: () => import('@/views/obs/SongRequestOBS.vue'), - meta: { - title: '弹幕点歌', - }, - }, ], }, { diff --git a/src/views/IndexView.vue b/src/views/IndexView.vue index 0d45acf..1ba4946 100644 --- a/src/views/IndexView.vue +++ b/src/views/IndexView.vue @@ -72,6 +72,7 @@ const iconColor = 'white'
+ { message.error('你不是从幻星平台访问此页面, 或未提供对应参数, 无法使用此功能') } }) -onUnmounted(() => { - client.value?.Stop() -})