mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
update url
This commit is contained in:
@@ -21,7 +21,7 @@ function changePassword() {
|
||||
return
|
||||
}
|
||||
isLoading.value = true
|
||||
QueryGetAPI(ACCOUNT_API_URL + 'verify/reset-password', {
|
||||
QueryGetAPI(ACCOUNT_API_URL() + 'verify/reset-password', {
|
||||
key: key.value,
|
||||
password: password.value,
|
||||
})
|
||||
@@ -34,7 +34,6 @@ function changePassword() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -43,7 +43,7 @@ const newFeedback = ref<FeedbackModel>({
|
||||
|
||||
async function get() {
|
||||
try {
|
||||
const data = await QueryGetAPI<ResponseFeedbackModel[]>(FEEDBACK_API_URL + 'get')
|
||||
const data = await QueryGetAPI<ResponseFeedbackModel[]>(FEEDBACK_API_URL() + 'get')
|
||||
if (data.code == 200) {
|
||||
return new List(data.data).OrderByDescending((s) => s.createAt).ToArray()
|
||||
} else {
|
||||
@@ -51,7 +51,6 @@ async function get() {
|
||||
return []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('无法获取数据')
|
||||
}
|
||||
return []
|
||||
@@ -61,7 +60,7 @@ async function add() {
|
||||
message.error('反馈内容不能为空')
|
||||
return
|
||||
}
|
||||
await QueryPostAPI<ResponseFeedbackModel>(FEEDBACK_API_URL + 'add', newFeedback.value)
|
||||
await QueryPostAPI<ResponseFeedbackModel>(FEEDBACK_API_URL() + 'add', newFeedback.value)
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('发送成功, 感谢你的反馈!')
|
||||
@@ -73,7 +72,6 @@ async function add() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发送失败')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ const menuOptions = [
|
||||
]
|
||||
|
||||
async function resendEmail() {
|
||||
await QueryGetAPI(ACCOUNT_API_URL + 'send-verify-email')
|
||||
await QueryGetAPI(ACCOUNT_API_URL() + 'send-verify-email')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
canResendEmail.value = false
|
||||
@@ -296,7 +296,6 @@ async function resendEmail() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发送失败')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const isLoading = ref(false)
|
||||
|
||||
async function VerifyAccount() {
|
||||
isLoading.value = true
|
||||
await QueryGetAPI<AccountInfo>(ACCOUNT_API_URL + 'verify', {
|
||||
await QueryGetAPI<AccountInfo>(ACCOUNT_API_URL() + 'verify', {
|
||||
target: route.query.target,
|
||||
})
|
||||
.then((data) => {
|
||||
|
||||
@@ -33,12 +33,11 @@ const totalTime = computed(() => {
|
||||
|
||||
async function get() {
|
||||
try {
|
||||
const data = await QueryGetAPI<VideoCollectDetail>(VIDEO_COLLECT_API_URL + 'get', { id: route.params.id })
|
||||
const data = await QueryGetAPI<VideoCollectDetail>(VIDEO_COLLECT_API_URL() + 'get', { id: route.params.id })
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('获取失败')
|
||||
}
|
||||
return null
|
||||
@@ -117,14 +116,12 @@ function formatSecondsToTime(seconds: number): string {
|
||||
<NDivider vertical />
|
||||
已观看 {{ watchedVideos.length }} 条
|
||||
</NDivider>
|
||||
<NAlert v-if="watchedVideos.length == acceptVideos?.length" type="success">
|
||||
已观看全部视频
|
||||
</NAlert>
|
||||
<NAlert v-if="watchedVideos.length == acceptVideos?.length" type="success"> 已观看全部视频 </NAlert>
|
||||
<NList ref="card">
|
||||
<NListItem v-for="item in acceptVideos" v-bind:key="item.info.bvid">
|
||||
<NCard size="small" :hoverable="!item.video.watched" :embedded="!item.video.watched">
|
||||
<NSpace>
|
||||
<NImage :src="item.video.cover + '@100h'" lazy :img-props="{ referrerpolicy: 'no-referrer' }" height="75" @click="onClick(item.video)" preview-disabled style="cursor: pointer"/>
|
||||
<NImage :src="item.video.cover + '@100h'" lazy :img-props="{ referrerpolicy: 'no-referrer' }" height="75" @click="onClick(item.video)" preview-disabled style="cursor: pointer" />
|
||||
<NSpace vertical :size="5">
|
||||
<NButton style="width: 100%; max-width: 100px" @click="onClick(item.video)" text>
|
||||
<NText :title="item.video.title" :delete="item.video.watched" :style="`color: ${item.video.watched ? '#a54e4e' : ''};width: ${width - 20}px;`">
|
||||
|
||||
@@ -28,12 +28,11 @@ const isLoading = ref(false)
|
||||
|
||||
async function get() {
|
||||
try {
|
||||
const data = await QueryGetAPI<VideoCollectDetail>(VIDEO_COLLECT_API_URL + 'get', { id: route.params.id })
|
||||
const data = await QueryGetAPI<VideoCollectDetail>(VIDEO_COLLECT_API_URL() + 'get', { id: route.params.id })
|
||||
if (data.code == 200) {
|
||||
return data.data.table
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('获取失败')
|
||||
}
|
||||
return null
|
||||
@@ -45,7 +44,7 @@ async function add() {
|
||||
}
|
||||
isLoading.value = true
|
||||
addModel.value.id = table.value?.id ?? route.params.id.toString()
|
||||
await QueryPostAPI(VIDEO_COLLECT_API_URL + 'add', addModel.value, [['Turnstile', token.value]])
|
||||
await QueryPostAPI(VIDEO_COLLECT_API_URL() + 'add', addModel.value, [['Turnstile', token.value]])
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已成功推荐视频')
|
||||
@@ -57,7 +56,6 @@ async function add() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('添加失败')
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -63,9 +63,6 @@ async function RequestBiliUserData() {
|
||||
throw new Error('Bili User API Error: ' + data.message)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
@@ -18,7 +18,7 @@ const roomId = ref()
|
||||
const timer = ref()
|
||||
|
||||
function onStartVerify() {
|
||||
QueryGetAPI(BILI_API_URL + 'verify', {
|
||||
QueryGetAPI(BILI_API_URL() + 'verify', {
|
||||
uId: uId.value,
|
||||
}).then((data) => {
|
||||
if (data.code == 200) {
|
||||
@@ -34,7 +34,7 @@ async function checkStatus() {
|
||||
uId: number
|
||||
roomId: number
|
||||
endTime: number
|
||||
}>(BILI_API_URL + 'status')
|
||||
}>(BILI_API_URL() + 'status')
|
||||
if (data.code == 200) {
|
||||
//正在进行认证
|
||||
roomId.value ??= data.data.roomId
|
||||
|
||||
@@ -38,7 +38,7 @@ function logout() {
|
||||
}
|
||||
function resetBili() {
|
||||
isLoading.value = true
|
||||
QueryGetAPI(ACCOUNT_API_URL + 'reset-bili')
|
||||
QueryGetAPI(ACCOUNT_API_URL() + 'reset-bili')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已解绑 Bilibili 账号')
|
||||
@@ -50,13 +50,12 @@ function resetBili() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
})
|
||||
}
|
||||
function resetEmail() {
|
||||
isLoading.value = true
|
||||
QueryGetAPI(ACCOUNT_API_URL + 'reset-email', { email: newEmailAddress.value, code: newEmailVerifyCode.value })
|
||||
QueryGetAPI(ACCOUNT_API_URL() + 'reset-email', { email: newEmailAddress.value, code: newEmailVerifyCode.value })
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已将邮箱改绑为 ' + newEmailAddress.value)
|
||||
@@ -68,12 +67,11 @@ function resetEmail() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
})
|
||||
}
|
||||
function sendEmailVerifyCode() {
|
||||
QueryGetAPI(ACCOUNT_API_URL + 'reset-email/code', { email: newEmailAddress.value })
|
||||
QueryGetAPI(ACCOUNT_API_URL() + 'reset-email/code', { email: newEmailAddress.value })
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('发送成功, 请检查目标邮箱. 如果没有收到, 请检查垃圾邮件')
|
||||
@@ -86,7 +84,6 @@ function sendEmailVerifyCode() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
})
|
||||
}
|
||||
@@ -95,7 +92,7 @@ async function resetPassword() {
|
||||
message.error('两次密码不一致')
|
||||
return
|
||||
}
|
||||
await QueryGetAPI(ACCOUNT_API_URL + 'verify/reset-password', { password: newPassword.value })
|
||||
await QueryGetAPI(ACCOUNT_API_URL() + 'verify/reset-password', { password: newPassword.value })
|
||||
.then(async (data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('密码已修改')
|
||||
@@ -107,7 +104,6 @@ async function resetPassword() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
})
|
||||
}
|
||||
@@ -122,7 +118,7 @@ async function BindBili() {
|
||||
uid: number
|
||||
uface: string
|
||||
room_id: number
|
||||
}>(ACCOUNT_API_URL + 'bind-bili', { code: biliCode.value }, [['Turnstile', token.value]])
|
||||
}>(ACCOUNT_API_URL() + 'bind-bili', { code: biliCode.value }, [['Turnstile', token.value]])
|
||||
.then(async (data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已绑定, 如无特殊情况请勿刷新身份码, 如果刷新了且还需要使用本站直播相关功能请更新身份码')
|
||||
@@ -134,7 +130,6 @@ async function BindBili() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -153,7 +148,7 @@ async function ChangeBili() {
|
||||
uid: number
|
||||
uface: string
|
||||
room_id: number
|
||||
}>(ACCOUNT_API_URL + 'change-bili', { code: biliCode.value }, [['Turnstile', token.value]])
|
||||
}>(ACCOUNT_API_URL() + 'change-bili', { code: biliCode.value }, [['Turnstile', token.value]])
|
||||
.then(async (data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已更新身份码')
|
||||
@@ -165,7 +160,6 @@ async function ChangeBili() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -86,7 +86,7 @@ async function onDateChange() {
|
||||
}
|
||||
async function get() {
|
||||
try {
|
||||
const data = await QueryGetAPI<EventModel[]>(BASE_API + 'event/get', {
|
||||
const data = await QueryGetAPI<EventModel[]>(BASE_API() + 'event/get', {
|
||||
start: selectedDate.value[0],
|
||||
end: selectedDate.value[1],
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@ async function getFansHistory() {
|
||||
time: number
|
||||
count: number
|
||||
}[]
|
||||
>(HISTORY_API_URL + 'fans')
|
||||
>(HISTORY_API_URL() + 'fans')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
fansHistory.value = data.data
|
||||
@@ -41,7 +41,6 @@ async function getFansHistory() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('加载失败')
|
||||
})
|
||||
}
|
||||
@@ -51,7 +50,7 @@ async function getGuardsHistory() {
|
||||
time: number
|
||||
count: number
|
||||
}[]
|
||||
>(HISTORY_API_URL + 'guards')
|
||||
>(HISTORY_API_URL() + 'guards')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
guardHistory.value = data.data
|
||||
@@ -60,7 +59,6 @@ async function getGuardsHistory() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('加载失败')
|
||||
})
|
||||
}
|
||||
@@ -73,7 +71,7 @@ async function getUpstatHistory() {
|
||||
likes: number
|
||||
}
|
||||
}[]
|
||||
>(HISTORY_API_URL + 'upstat')
|
||||
>(HISTORY_API_URL() + 'upstat')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
upstatHistory.value = data.data
|
||||
@@ -82,7 +80,6 @@ async function getUpstatHistory() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('加载失败')
|
||||
})
|
||||
}
|
||||
@@ -97,7 +94,6 @@ function getOptions() {
|
||||
time: Date
|
||||
count: number
|
||||
}[] = []
|
||||
let guards = [] as { time: number; count: number; timeString: string }[]
|
||||
|
||||
if (fansHistory.value) {
|
||||
const startTime = new Date(fansHistory.value[0].time)
|
||||
@@ -143,14 +139,21 @@ function getOptions() {
|
||||
|
||||
let lastDayGuards = 0
|
||||
let lastDay = 0
|
||||
let guardsIncreacement = [] as { time: number; count: number; timeString: string }[]
|
||||
let guards = [] as { time: number; count: number; timeString: string }[]
|
||||
guardHistory.value?.forEach((g) => {
|
||||
if (!isSameDaySimple(g.time, lastDayGuards)) {
|
||||
guards.push({
|
||||
if (!isSameDay(g.time, lastDay)) {
|
||||
guardsIncreacement.push({
|
||||
time: lastDayGuards,
|
||||
count: lastDay == 0 ? 0 : g.count - lastDayGuards,
|
||||
//将timeString转换为yyyy-MM-dd HH
|
||||
timeString: format(g.time, 'yyyy-MM-dd'),
|
||||
})
|
||||
guards.push({
|
||||
time: g.time,
|
||||
count: g.count,
|
||||
timeString: format(g.time, 'yyyy-MM-dd'),
|
||||
})
|
||||
lastDay = g.time
|
||||
lastDayGuards = g.count
|
||||
}
|
||||
@@ -238,7 +241,7 @@ function getOptions() {
|
||||
axisTick: {
|
||||
alignWithLabel: true,
|
||||
},
|
||||
boundaryGap: false, // 设置为false使得柱状图紧贴左右两侧
|
||||
//boundaryGap: chartData.dailyIncrements.length < 15, // 设置为false使得柱状图紧贴左右两侧
|
||||
axisLine: {
|
||||
onZero: false,
|
||||
lineStyle: {
|
||||
@@ -292,6 +295,9 @@ function getOptions() {
|
||||
{
|
||||
type: 'value',
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
},
|
||||
],
|
||||
xAxis: [
|
||||
{
|
||||
@@ -306,7 +312,7 @@ function getOptions() {
|
||||
},
|
||||
},
|
||||
// prettier-ignore
|
||||
data: guards.map((f) => f.timeString ),
|
||||
data: guardsIncreacement.map((f) => f.timeString),
|
||||
},
|
||||
],
|
||||
series: [
|
||||
@@ -319,6 +325,15 @@ function getOptions() {
|
||||
},
|
||||
data: guards.map((f) => f.count),
|
||||
},
|
||||
{
|
||||
name: '日增',
|
||||
type: 'bar',
|
||||
yAxisIndex: 1,
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
},
|
||||
data: guardsIncreacement.map((f) => f.count),
|
||||
},
|
||||
],
|
||||
dataZoom: [
|
||||
{
|
||||
|
||||
@@ -22,9 +22,9 @@ const liveInfo = ref<ResponseLiveDetail | undefined>(await get())
|
||||
|
||||
async function get() {
|
||||
try {
|
||||
const data = await QueryGetAPI<ResponseLiveDetail>(LIVE_API_URL + 'get', {
|
||||
const data = await QueryGetAPI<ResponseLiveDetail>(LIVE_API_URL() + 'get', {
|
||||
id: route.params.id,
|
||||
useEmoji: true
|
||||
useEmoji: true,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
@@ -33,7 +33,6 @@ async function get() {
|
||||
return undefined
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('无法获取数据')
|
||||
}
|
||||
return undefined
|
||||
|
||||
@@ -21,7 +21,7 @@ const defaultDanmakusCount = ref(0)
|
||||
|
||||
async function getAll() {
|
||||
try {
|
||||
const data = await QueryGetAPI<ResponseLiveInfoModel[]>(LIVE_API_URL + 'get-all')
|
||||
const data = await QueryGetAPI<ResponseLiveInfoModel[]>(LIVE_API_URL() + 'get-all')
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
} else {
|
||||
@@ -29,7 +29,6 @@ async function getAll() {
|
||||
return []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('无法获取数据')
|
||||
}
|
||||
return []
|
||||
|
||||
@@ -164,7 +164,6 @@ async function getCommentsUsers() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('获取失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -191,7 +190,6 @@ async function getForwardUsers() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('获取失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -249,7 +247,6 @@ function startLottery() {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ const shareUrl = computed(() => 'https://vtsuru.live/user/' + accountInfo.value?
|
||||
|
||||
async function GetRecieveQAInfo() {
|
||||
isLoading.value = true
|
||||
await QueryGetAPI<QAInfo[]>(QUESTION_API_URL + 'get-recieve')
|
||||
await QueryGetAPI<QAInfo[]>(QUESTION_API_URL() + 'get-recieve')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
if (data.data.length > 0) {
|
||||
@@ -84,7 +84,6 @@ async function GetRecieveQAInfo() {
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('发生错误')
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
@@ -92,7 +91,7 @@ async function GetRecieveQAInfo() {
|
||||
}
|
||||
async function GetSendQAInfo() {
|
||||
isLoading.value = true
|
||||
await QueryGetAPI<QAInfo[]>(QUESTION_API_URL + 'get-send')
|
||||
await QueryGetAPI<QAInfo[]>(QUESTION_API_URL() + 'get-send')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
sendQuestions.value = data.data
|
||||
@@ -103,7 +102,6 @@ async function GetSendQAInfo() {
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('发生错误')
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
@@ -111,7 +109,7 @@ async function GetSendQAInfo() {
|
||||
}
|
||||
async function reply() {
|
||||
isRepling.value = true
|
||||
await QueryPostAPI<QAInfo>(QUESTION_API_URL + 'reply', {
|
||||
await QueryPostAPI<QAInfo>(QUESTION_API_URL() + 'reply', {
|
||||
Id: currentQuestion.value?.id,
|
||||
Message: replyMessage.value,
|
||||
})
|
||||
@@ -129,7 +127,6 @@ async function reply() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('发送失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -137,7 +134,7 @@ async function reply() {
|
||||
})
|
||||
}
|
||||
async function read(question: QAInfo, read: boolean) {
|
||||
await QueryGetAPI(QUESTION_API_URL + 'read', {
|
||||
await QueryGetAPI(QUESTION_API_URL() + 'read', {
|
||||
id: question.id,
|
||||
read: read ? 'true' : 'false',
|
||||
})
|
||||
@@ -149,12 +146,11 @@ async function read(question: QAInfo, read: boolean) {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('修改失败')
|
||||
})
|
||||
}
|
||||
async function favorite(question: QAInfo, fav: boolean) {
|
||||
await QueryGetAPI(QUESTION_API_URL + 'favorite', {
|
||||
await QueryGetAPI(QUESTION_API_URL() + 'favorite', {
|
||||
id: question.id,
|
||||
favorite: fav,
|
||||
})
|
||||
@@ -166,13 +162,12 @@ async function favorite(question: QAInfo, fav: boolean) {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('修改失败')
|
||||
})
|
||||
}
|
||||
async function setPublic(pub: boolean) {
|
||||
isChangingPublic.value = true
|
||||
await QueryGetAPI(QUESTION_API_URL + 'public', {
|
||||
await QueryGetAPI(QUESTION_API_URL() + 'public', {
|
||||
id: currentQuestion.value?.id,
|
||||
public: pub,
|
||||
})
|
||||
@@ -185,7 +180,6 @@ async function setPublic(pub: boolean) {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('修改失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -193,30 +187,25 @@ async function setPublic(pub: boolean) {
|
||||
})
|
||||
}
|
||||
async function blacklist(question: QAInfo) {
|
||||
await QueryGetAPI(ACCOUNT_API_URL + 'black-list/add', {
|
||||
await QueryGetAPI(ACCOUNT_API_URL() + 'black-list/add', {
|
||||
id: question.sender.id,
|
||||
})
|
||||
.then(async (data) => {
|
||||
if (data.code == 200) {
|
||||
await QueryGetAPI(QUESTION_API_URL + 'del', {
|
||||
await QueryGetAPI(QUESTION_API_URL() + 'del', {
|
||||
id: question.id,
|
||||
}).then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已拉黑 ' + question.sender.name)
|
||||
} else {
|
||||
message.error('修改失败: ' + data.message)
|
||||
}
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已拉黑 ' + question.sender.name)
|
||||
} else {
|
||||
message.error('修改失败: ' + data.message)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
} else {
|
||||
message.error('拉黑失败: ' + data.message)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('拉黑失败')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ const selectedScheduleWeek = ref(Number(format(Date.now(), 'w')) + 1)
|
||||
|
||||
async function get() {
|
||||
isLoading.value = true
|
||||
await QueryGetAPI<ScheduleWeekInfo[]>(SCHEDULE_API_URL + 'get', {
|
||||
await QueryGetAPI<ScheduleWeekInfo[]>(SCHEDULE_API_URL() + 'get', {
|
||||
id: accountInfo.value?.id ?? -1,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -130,7 +130,6 @@ async function get() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('加载失败')
|
||||
})
|
||||
.finally(() => (isLoading.value = false))
|
||||
@@ -138,7 +137,7 @@ async function get() {
|
||||
const isFetching = ref(false)
|
||||
async function addSchedule() {
|
||||
isFetching.value = true
|
||||
await QueryPostAPI(SCHEDULE_API_URL + 'update', {
|
||||
await QueryPostAPI(SCHEDULE_API_URL() + 'update', {
|
||||
year: selectedScheduleYear.value,
|
||||
week: selectedScheduleWeek.value,
|
||||
})
|
||||
@@ -167,7 +166,7 @@ async function onCopySchedule() {
|
||||
}
|
||||
async function onUpdateSchedule() {
|
||||
isFetching.value = true
|
||||
await QueryPostAPI(SCHEDULE_API_URL + 'update', {
|
||||
await QueryPostAPI(SCHEDULE_API_URL() + 'update', {
|
||||
year: updateScheduleModel.value.year,
|
||||
week: updateScheduleModel.value.week,
|
||||
day: selectedDay.value,
|
||||
@@ -192,7 +191,7 @@ async function onUpdateSchedule() {
|
||||
})
|
||||
}
|
||||
async function onDeleteSchedule(schedule: ScheduleWeekInfo) {
|
||||
await QueryGetAPI(SCHEDULE_API_URL + 'del', {
|
||||
await QueryGetAPI(SCHEDULE_API_URL() + 'del', {
|
||||
year: schedule.year,
|
||||
week: schedule.week,
|
||||
}).then((data) => {
|
||||
|
||||
@@ -199,9 +199,6 @@ async function RequestBiliUserData() {
|
||||
throw new Error('Bili User API Error: ' + data.message)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
async function SaveComboGroupSetting(value: (string | number)[], meta: { actionType: 'check' | 'uncheck'; value: string | number }) {
|
||||
if (accountInfo.value) {
|
||||
@@ -219,7 +216,6 @@ async function SaveComboGroupSetting(value: (string | number)[], meta: { actionT
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('修改失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -240,7 +236,6 @@ async function SaveComboSetting() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('修改失败')
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -164,7 +164,6 @@ async function addCustomSong() {
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('添加失败')
|
||||
console.error(err)
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -190,7 +189,6 @@ async function addNeteaseSongs() {
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('添加失败')
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
isModalLoading.value = false
|
||||
@@ -205,7 +203,6 @@ async function addFingsingSongs(song: SongsInfo) {
|
||||
} catch (err) {
|
||||
isModalLoading.value = false
|
||||
message.error('添加失败')
|
||||
console.error(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -221,7 +218,6 @@ async function addFingsingSongs(song: SongsInfo) {
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('添加失败')
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
isModalLoading.value = false
|
||||
@@ -243,7 +239,7 @@ async function addSongs(songsShoudAdd: SongsInfo[], from: SongFrom) {
|
||||
|
||||
async function getNeteaseSongList() {
|
||||
isModalLoading.value = true
|
||||
await QueryGetAPI<SongsInfo[]>(SONG_API_URL + 'get-netease-list', {
|
||||
await QueryGetAPI<SongsInfo[]>(SONG_API_URL() + 'get-netease-list', {
|
||||
id: neteaseSongListId.value,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -260,7 +256,6 @@ async function getNeteaseSongList() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('获取歌单失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -293,7 +288,6 @@ async function getFivesingSearchList(isRestart = false) {
|
||||
message.success(`成功获取搜索信息, 共 ${json.pageInfo.totalCount} 条, 当前第 ${fivesingCurrentPage.value} 页`)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('获取歌单失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -316,7 +310,6 @@ async function playFivesingSong(song: SongsInfo) {
|
||||
song.url = data
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('获取歌曲链接失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -336,7 +329,7 @@ async function getFivesingSongUrl(song: SongsInfo): Promise<string> {
|
||||
const isLoading = ref(true)
|
||||
async function getSongs() {
|
||||
isLoading.value = true
|
||||
await QueryGetAPI<any>(SONG_API_URL + 'get', {
|
||||
await QueryGetAPI<any>(SONG_API_URL() + 'get', {
|
||||
id: accountInfo.value?.id,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -345,7 +338,6 @@ async function getSongs() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('获取歌曲失败: ' + err)
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -108,7 +108,7 @@ const acceptVideos = computed(() => {
|
||||
|
||||
async function getData() {
|
||||
try {
|
||||
const data = await QueryGetAPI<VideoCollectDetail>(VIDEO_COLLECT_API_URL + 'get', { id: route.params.id })
|
||||
const data = await QueryGetAPI<VideoCollectDetail>(VIDEO_COLLECT_API_URL() + 'get', { id: route.params.id })
|
||||
if (data.code == 200) {
|
||||
updateModel.value = {
|
||||
id: data.data.table.id,
|
||||
@@ -120,7 +120,6 @@ async function getData() {
|
||||
return data.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('获取失败')
|
||||
}
|
||||
return {} as VideoCollectDetail
|
||||
@@ -201,7 +200,7 @@ const rejectButtonGroup = (v: VideoInfo) =>
|
||||
])
|
||||
function setStatus(status: VideoStatus, video: VideoInfo) {
|
||||
isLoading.value = true
|
||||
QueryGetAPI(VIDEO_COLLECT_API_URL + 'set-status', {
|
||||
QueryGetAPI(VIDEO_COLLECT_API_URL() + 'set-status', {
|
||||
id: videoDetail.value.table.id,
|
||||
bvid: video.bvid,
|
||||
status: status,
|
||||
@@ -215,7 +214,6 @@ function setStatus(status: VideoStatus, video: VideoInfo) {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('设置失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -237,7 +235,7 @@ function dateDisabled(ts: number) {
|
||||
function updateTable() {
|
||||
isLoading.value = true
|
||||
updateModel.value.id = videoDetail.value.table.id
|
||||
QueryPostAPI<VideoCollectTable>(VIDEO_COLLECT_API_URL + 'update', updateModel.value)
|
||||
QueryPostAPI<VideoCollectTable>(VIDEO_COLLECT_API_URL() + 'update', updateModel.value)
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('更新成功')
|
||||
@@ -247,7 +245,6 @@ function updateTable() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('更新失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -256,7 +253,7 @@ function updateTable() {
|
||||
}
|
||||
function deleteTable() {
|
||||
isLoading.value = true
|
||||
QueryGetAPI(VIDEO_COLLECT_API_URL + 'del', {
|
||||
QueryGetAPI(VIDEO_COLLECT_API_URL() + 'del', {
|
||||
id: videoDetail.value.table.id,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -270,7 +267,6 @@ function deleteTable() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('删除失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -279,7 +275,7 @@ function deleteTable() {
|
||||
}
|
||||
function closeTable() {
|
||||
isLoading.value = true
|
||||
QueryGetAPI(VIDEO_COLLECT_API_URL + 'finish', {
|
||||
QueryGetAPI(VIDEO_COLLECT_API_URL() + 'finish', {
|
||||
id: videoDetail.value.table.id,
|
||||
finish: !videoDetail.value.table.isFinish,
|
||||
})
|
||||
@@ -292,7 +288,6 @@ function closeTable() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('操作失败')
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -94,7 +94,7 @@ const isLoading2 = ref(false)
|
||||
async function get() {
|
||||
try {
|
||||
isLoading.value = true
|
||||
const data = await QueryGetAPI<VideoCollectTable[]>(VIDEO_COLLECT_API_URL + 'get-all')
|
||||
const data = await QueryGetAPI<VideoCollectTable[]>(VIDEO_COLLECT_API_URL() + 'get-all')
|
||||
if (data.code == 200) {
|
||||
//videoTables.value = data.data
|
||||
return data.data
|
||||
@@ -103,7 +103,6 @@ async function get() {
|
||||
return []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('获取失败')
|
||||
return []
|
||||
} finally {
|
||||
@@ -113,7 +112,7 @@ async function get() {
|
||||
function createTable() {
|
||||
formRef.value?.validate().then(async () => {
|
||||
isLoading2.value = true
|
||||
QueryPostAPI<VideoCollectTable>(VIDEO_COLLECT_API_URL + 'create', createVideoModel.value)
|
||||
QueryPostAPI<VideoCollectTable>(VIDEO_COLLECT_API_URL() + 'create', createVideoModel.value)
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
videoTables.value.push(data.data)
|
||||
@@ -125,7 +124,6 @@ function createTable() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('创建失败')
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -30,15 +30,13 @@ const isMoreThanContainer = computed(() => {
|
||||
|
||||
async function getUsers() {
|
||||
try {
|
||||
const data = await QueryGetAPI<UpdateLiveLotteryUsersModel>(LOTTERY_API_URL + 'live/get-users', {
|
||||
const data = await QueryGetAPI<UpdateLiveLotteryUsersModel>(LOTTERY_API_URL() + 'live/get-users', {
|
||||
code: currentCode.value,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
} catch (err) {}
|
||||
return {
|
||||
users: [],
|
||||
resultUsers: [],
|
||||
|
||||
@@ -54,15 +54,13 @@ const activeItems = computed(() => {
|
||||
|
||||
async function get() {
|
||||
try {
|
||||
const data = await QueryGetAPI<{ queue: ResponseQueueModel[]; setting: Setting_Queue }>(QUEUE_API_URL + 'get-active-and-settings', {
|
||||
const data = await QueryGetAPI<{ queue: ResponseQueueModel[]; setting: Setting_Queue }>(QUEUE_API_URL() + 'get-active-and-settings', {
|
||||
id: currentId.value,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
} catch (err) {}
|
||||
return {} as { queue: ResponseQueueModel[]; setting: Setting_Queue }
|
||||
}
|
||||
const isMoreThanContainer = computed(() => {
|
||||
@@ -119,7 +117,15 @@ onUnmounted(() => {
|
||||
<div class="queue-content" ref="listContainerRef">
|
||||
<template v-if="activeItems.length > 0">
|
||||
<Vue3Marquee class="queue-list" :key="key" vertical :pause="!isMoreThanContainer" :duration="20" :style="`height: ${height}px;width: ${width}px;`">
|
||||
<span class="queue-list-item" :from="(item.from as number)" :status="(item.status as number)" :payment="item.giftPrice ?? 0" v-for="item in activeItems" :key="item.id" :style="`height: ${itemHeight}px`">
|
||||
<span
|
||||
class="queue-list-item"
|
||||
:from="(item.from as number)"
|
||||
:status="(item.status as number)"
|
||||
:payment="item.giftPrice ?? 0"
|
||||
v-for="item in activeItems"
|
||||
:key="item.id"
|
||||
:style="`height: ${itemHeight}px`"
|
||||
>
|
||||
<div class="queue-list-item-level" :has-level="(item.user?.fans_medal_level ?? 0) > 0">
|
||||
{{ item.user?.fans_medal_level }}
|
||||
</div>
|
||||
@@ -302,7 +308,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
/* 弹幕点歌 */
|
||||
.queue-list-item[payment='0'] .queue-list-item-payment{
|
||||
.queue-list-item[payment='0'] .queue-list-item-payment {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,15 +39,13 @@ const activeSongs = computed(() => {
|
||||
|
||||
async function get() {
|
||||
try {
|
||||
const data = await QueryGetAPI<{ songs: SongRequestInfo[]; setting: Setting_SongRequest }>(SONG_REQUEST_API_URL + 'get-active-and-settings', {
|
||||
const data = await QueryGetAPI<{ songs: SongRequestInfo[]; setting: Setting_SongRequest }>(SONG_REQUEST_API_URL() + 'get-active-and-settings', {
|
||||
id: currentId.value,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
} catch (err) {}
|
||||
return {} as { songs: SongRequestInfo[]; setting: Setting_SongRequest }
|
||||
}
|
||||
const isMoreThanContainer = computed(() => {
|
||||
|
||||
@@ -180,7 +180,7 @@ const table = ref()
|
||||
async function getAllSong() {
|
||||
if (accountInfo.value) {
|
||||
try {
|
||||
const data = await QueryGetAPI<SongRequestInfo[]>(SONG_REQUEST_API_URL + 'get-all', {
|
||||
const data = await QueryGetAPI<SongRequestInfo[]>(SONG_REQUEST_API_URL() + 'get-all', {
|
||||
id: accountInfo.value.id,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
@@ -191,7 +191,6 @@ async function getAllSong() {
|
||||
return []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('无法获取数据')
|
||||
}
|
||||
return []
|
||||
@@ -202,26 +201,22 @@ async function getAllSong() {
|
||||
async function addSong(danmaku: EventModel) {
|
||||
console.log(`[OPEN-LIVE-Song-Request] 收到 [${danmaku.name}] 的点歌${danmaku.type == EventDataTypes.SC ? 'SC' : '弹幕'}: ${danmaku.msg}`)
|
||||
if (accountInfo.value) {
|
||||
await QueryPostAPI<SongRequestInfo>(SONG_REQUEST_API_URL + 'try-add', danmaku)
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success(`[${danmaku.name}] 添加曲目: ${data.data.songName}`)
|
||||
if (data.message != 'EventFetcher') originSongs.value.unshift(data.data)
|
||||
} else {
|
||||
//message.error(`[${danmaku.name}] 添加曲目失败: ${data.message}`)
|
||||
const time = Date.now()
|
||||
notice.warning({
|
||||
title: danmaku.name + ' 点歌失败',
|
||||
description: data.message,
|
||||
duration: isWarnMessageAutoClose.value ? 3000 : 0,
|
||||
meta: () => h(NTime, { type: 'relative', time: time, key: updateKey.value }),
|
||||
})
|
||||
console.log(`[OPEN-LIVE-Song-Request] [${danmaku.name}] 添加曲目失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
await QueryPostAPI<SongRequestInfo>(SONG_REQUEST_API_URL() + 'try-add', danmaku).then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success(`[${danmaku.name}] 添加曲目: ${data.data.songName}`)
|
||||
if (data.message != 'EventFetcher') originSongs.value.unshift(data.data)
|
||||
} else {
|
||||
//message.error(`[${danmaku.name}] 添加曲目失败: ${data.message}`)
|
||||
const time = Date.now()
|
||||
notice.warning({
|
||||
title: danmaku.name + ' 点歌失败',
|
||||
description: data.message,
|
||||
duration: isWarnMessageAutoClose.value ? 3000 : 0,
|
||||
meta: () => h(NTime, { type: 'relative', time: time, key: updateKey.value }),
|
||||
})
|
||||
console.log(`[OPEN-LIVE-Song-Request] [${danmaku.name}] 添加曲目失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const songData = {
|
||||
songName: danmaku.msg.trim().substring(settings.value.orderPrefix.length),
|
||||
@@ -251,22 +246,18 @@ async function addSongManual() {
|
||||
return
|
||||
}
|
||||
if (accountInfo.value) {
|
||||
await QueryPostAPIWithParams<SongRequestInfo>(SONG_REQUEST_API_URL + 'add', {
|
||||
await QueryPostAPIWithParams<SongRequestInfo>(SONG_REQUEST_API_URL() + 'add', {
|
||||
name: newSongName.value,
|
||||
}).then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success(`已手动添加曲目: ${data.data.songName}`)
|
||||
originSongs.value.unshift(data.data)
|
||||
newSongName.value = ''
|
||||
console.log(`[OPEN-LIVE-Song-Request] 已手动添加曲目: ${data.data.songName}`)
|
||||
} else {
|
||||
message.error(`手动添加曲目失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success(`已手动添加曲目: ${data.data.songName}`)
|
||||
originSongs.value.unshift(data.data)
|
||||
newSongName.value = ''
|
||||
console.log(`[OPEN-LIVE-Song-Request] 已手动添加曲目: ${data.data.songName}`)
|
||||
} else {
|
||||
message.error(`手动添加曲目失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
} else {
|
||||
const songData = {
|
||||
songName: newSongName.value,
|
||||
@@ -309,7 +300,7 @@ async function updateSongStatus(song: SongRequestInfo, status: SongRequestStatus
|
||||
statusString2 = '演唱中'
|
||||
break
|
||||
}
|
||||
await QueryGetAPI(SONG_REQUEST_API_URL + statusString, {
|
||||
await QueryGetAPI(SONG_REQUEST_API_URL() + statusString, {
|
||||
id: song.id,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -326,7 +317,6 @@ async function updateSongStatus(song: SongRequestInfo, status: SongRequestStatus
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error(`更新曲目状态失败`)
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -400,7 +390,6 @@ async function onUpdateFunctionEnable() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error(`点歌功能${accountInfo.value?.settings.enableFunctions.includes(FunctionTypes.SongRequest) ? '启用' : '禁用'}失败: ${err}`)
|
||||
})
|
||||
}
|
||||
@@ -408,7 +397,7 @@ async function onUpdateFunctionEnable() {
|
||||
async function updateSettings() {
|
||||
if (accountInfo.value) {
|
||||
isLoading.value = true
|
||||
await QueryPostAPI(SONG_REQUEST_API_URL + 'update-setting', settings.value)
|
||||
await QueryPostAPI(SONG_REQUEST_API_URL() + 'update-setting', settings.value)
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已保存')
|
||||
@@ -417,7 +406,6 @@ async function updateSettings() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('保存失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -438,16 +426,14 @@ async function deleteSongs(values: SongRequestInfo[]) {
|
||||
originSongs.value = originSongs.value.filter((s) => !values.includes(s))
|
||||
} else {
|
||||
message.error('删除失败: ' + data.message)
|
||||
console.error('删除失败: ' + data.message)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('删除失败')
|
||||
})
|
||||
}
|
||||
async function deactiveAllSongs() {
|
||||
await QueryGetAPI(SONG_REQUEST_API_URL + 'deactive')
|
||||
await QueryGetAPI(SONG_REQUEST_API_URL() + 'deactive')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已全部取消')
|
||||
@@ -461,7 +447,6 @@ async function deactiveAllSongs() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('取消失败')
|
||||
})
|
||||
}
|
||||
@@ -666,7 +651,7 @@ function GetGuardColor(level: number | null | undefined): string {
|
||||
async function updateActive() {
|
||||
if (!accountInfo.value) return
|
||||
try {
|
||||
const data = await QueryGetAPI<SongRequestInfo[]>(SONG_REQUEST_API_URL + 'get-active', {
|
||||
const data = await QueryGetAPI<SongRequestInfo[]>(SONG_REQUEST_API_URL() + 'get-active', {
|
||||
id: accountInfo.value?.id,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
@@ -685,9 +670,7 @@ async function updateActive() {
|
||||
message.error('无法获取点歌队列: ' + data.message)
|
||||
return []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
} catch (err) {}
|
||||
}
|
||||
const isLrcLoading = ref('')
|
||||
|
||||
|
||||
@@ -104,25 +104,23 @@ const props = defineProps<{
|
||||
|
||||
async function getUsers() {
|
||||
try {
|
||||
const data = await QueryGetAPI<UpdateLiveLotteryUsersModel>(LOTTERY_API_URL + 'live/get-users', {
|
||||
const data = await QueryGetAPI<UpdateLiveLotteryUsersModel>(LOTTERY_API_URL() + 'live/get-users', {
|
||||
code: props.code,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
} catch (err) {}
|
||||
return null
|
||||
}
|
||||
function updateUsers() {
|
||||
QueryPostAPI(LOTTERY_API_URL + 'live/update-users', {
|
||||
QueryPostAPI(LOTTERY_API_URL() + 'live/update-users', {
|
||||
code: props.code,
|
||||
users: originUsers.value,
|
||||
resultUsers: resultUsers.value,
|
||||
type: isLotteried.value ? OpenLiveLotteryType.Result : OpenLiveLotteryType.Waiting,
|
||||
}).catch((err) => {
|
||||
console.error('[OPEN-LIVE-Lottery] 更新历史抽奖用户失败: ' + err)
|
||||
console.error('[OPEN-LIVE-Lottery] 更新历史抽奖用户失败')
|
||||
})
|
||||
}
|
||||
function addUser(user: OpenLiveLotteryUserInfo, danmu: any) {
|
||||
@@ -213,7 +211,6 @@ function startLottery() {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('发生错误')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ const table = ref()
|
||||
async function getAll() {
|
||||
if (accountInfo.value) {
|
||||
try {
|
||||
const data = await QueryGetAPI<ResponseQueueModel[]>(QUEUE_API_URL + 'get-all', {
|
||||
const data = await QueryGetAPI<ResponseQueueModel[]>(QUEUE_API_URL() + 'get-all', {
|
||||
id: accountInfo.value.id,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
@@ -202,7 +202,6 @@ async function getAll() {
|
||||
return []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('无法获取数据')
|
||||
}
|
||||
return []
|
||||
@@ -216,37 +215,33 @@ async function add(danmaku: EventModel) {
|
||||
}
|
||||
console.log(`[OPEN-LIVE-QUEUE] 收到 [${danmaku.name}] 的排队请求`)
|
||||
if (accountInfo.value) {
|
||||
await QueryPostAPI<ResponseQueueModel>(QUEUE_API_URL + 'try-add', danmaku)
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
if (data.message != 'EventFetcher') {
|
||||
//如果存在则替换, 否则插入最后
|
||||
const index = originQueue.value.findIndex((q) => q.id == data.data.id)
|
||||
if (index > -1) {
|
||||
message.info(
|
||||
`${data.data.user?.name} 通过发送礼物再次付费: ¥ ${((data.data?.giftPrice ?? 0) - (originQueue.value[index]?.giftPrice ?? 0)).toFixed(1)}, 当前总计付费: ¥ ${data.data.giftPrice}`
|
||||
)
|
||||
originQueue.value.splice(index, 1, data.data)
|
||||
} else {
|
||||
originQueue.value.push(data.data)
|
||||
message.success(`[${danmaku.name}] 添加至队列`)
|
||||
}
|
||||
await QueryPostAPI<ResponseQueueModel>(QUEUE_API_URL() + 'try-add', danmaku).then((data) => {
|
||||
if (data.code == 200) {
|
||||
if (data.message != 'EventFetcher') {
|
||||
//如果存在则替换, 否则插入最后
|
||||
const index = originQueue.value.findIndex((q) => q.id == data.data.id)
|
||||
if (index > -1) {
|
||||
message.info(
|
||||
`${data.data.user?.name} 通过发送礼物再次付费: ¥ ${((data.data?.giftPrice ?? 0) - (originQueue.value[index]?.giftPrice ?? 0)).toFixed(1)}, 当前总计付费: ¥ ${data.data.giftPrice}`
|
||||
)
|
||||
originQueue.value.splice(index, 1, data.data)
|
||||
} else {
|
||||
originQueue.value.push(data.data)
|
||||
message.success(`[${danmaku.name}] 添加至队列`)
|
||||
}
|
||||
} else {
|
||||
//message.error(`[${danmaku.name}] 添加曲目失败: ${data.message}`)
|
||||
const time = Date.now()
|
||||
notice.warning({
|
||||
title: danmaku.name + ' 排队失败',
|
||||
description: data.message,
|
||||
duration: isWarnMessageAutoClose.value ? 3000 : 0,
|
||||
meta: () => h(NTime, { type: 'relative', time: time, key: updateKey.value }),
|
||||
})
|
||||
console.log(`[OPEN-LIVE-QUEUE] [${danmaku.name}] 排队失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
} else {
|
||||
//message.error(`[${danmaku.name}] 添加曲目失败: ${data.message}`)
|
||||
const time = Date.now()
|
||||
notice.warning({
|
||||
title: danmaku.name + ' 排队失败',
|
||||
description: data.message,
|
||||
duration: isWarnMessageAutoClose.value ? 3000 : 0,
|
||||
meta: () => h(NTime, { type: 'relative', time: time, key: updateKey.value }),
|
||||
})
|
||||
console.log(`[OPEN-LIVE-QUEUE] [${danmaku.name}] 排队失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const songData = {
|
||||
status: QueueStatus.Waiting,
|
||||
@@ -274,22 +269,18 @@ async function addManual() {
|
||||
return
|
||||
}
|
||||
if (accountInfo.value) {
|
||||
await QueryPostAPIWithParams<ResponseQueueModel>(QUEUE_API_URL + 'add', {
|
||||
await QueryPostAPIWithParams<ResponseQueueModel>(QUEUE_API_URL() + 'add', {
|
||||
name: newQueueName.value,
|
||||
}).then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success(`已手动添加用户至队列: ${data.data.user?.name}`)
|
||||
originQueue.value.unshift(data.data)
|
||||
newQueueName.value = ''
|
||||
console.log(`[OPEN-LIVE-QUEUE] 已手动添加用户至队列: ${data.data.user?.name}`)
|
||||
} else {
|
||||
message.error(`手动添加失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success(`已手动添加用户至队列: ${data.data.user?.name}`)
|
||||
originQueue.value.unshift(data.data)
|
||||
newQueueName.value = ''
|
||||
console.log(`[OPEN-LIVE-QUEUE] 已手动添加用户至队列: ${data.data.user?.name}`)
|
||||
} else {
|
||||
message.error(`手动添加失败: ${data.message}`)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
} else {
|
||||
const songData = {
|
||||
status: QueueStatus.Waiting,
|
||||
@@ -311,7 +302,7 @@ async function updateStatus(queueData: ResponseQueueModel, status: QueueStatus)
|
||||
return
|
||||
}
|
||||
isLoading.value = true
|
||||
await QueryGetAPI(QUEUE_API_URL + 'set-status', {
|
||||
await QueryGetAPI(QUEUE_API_URL() + 'set-status', {
|
||||
id: queueData.id,
|
||||
status: status,
|
||||
})
|
||||
@@ -329,7 +320,6 @@ async function updateStatus(queueData: ResponseQueueModel, status: QueueStatus)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error(`更新队列状态失败`)
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -427,7 +417,6 @@ async function onUpdateFunctionEnable() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error(`队列功能${accountInfo.value?.settings.enableFunctions.includes(FunctionTypes.SongRequest) ? '启用' : '禁用'}失败: ${err}`)
|
||||
})
|
||||
}
|
||||
@@ -435,7 +424,7 @@ async function onUpdateFunctionEnable() {
|
||||
async function updateSettings() {
|
||||
if (accountInfo.value) {
|
||||
isLoading.value = true
|
||||
await QueryPostAPI(QUEUE_API_URL + 'update-setting', settings.value)
|
||||
await QueryPostAPI(QUEUE_API_URL() + 'update-setting', settings.value)
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已保存')
|
||||
@@ -444,7 +433,6 @@ async function updateSettings() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('保存失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -469,12 +457,11 @@ async function deleteQueue(values: ResponseQueueModel[]) {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('删除失败')
|
||||
})
|
||||
}
|
||||
async function deactiveAllSongs() {
|
||||
await QueryGetAPI(QUEUE_API_URL + 'deactive')
|
||||
await QueryGetAPI(QUEUE_API_URL() + 'deactive')
|
||||
.then((data) => {
|
||||
if (data.code == 200) {
|
||||
message.success('已全部取消')
|
||||
@@ -488,7 +475,6 @@ async function deactiveAllSongs() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('取消失败')
|
||||
})
|
||||
}
|
||||
@@ -677,7 +663,7 @@ function GetGuardColor(level: number | null | undefined): string {
|
||||
async function updateActive() {
|
||||
if (!accountInfo.value) return
|
||||
try {
|
||||
const data = await QueryGetAPI<ResponseQueueModel[]>(QUEUE_API_URL + 'get-active', {
|
||||
const data = await QueryGetAPI<ResponseQueueModel[]>(QUEUE_API_URL() + 'get-active', {
|
||||
id: accountInfo.value?.id,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
@@ -700,9 +686,7 @@ async function updateActive() {
|
||||
message.error('无法获取队列: ' + data.message)
|
||||
return []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
} catch (err) {}
|
||||
}
|
||||
let timer: any
|
||||
let updateActiveTimer: any
|
||||
@@ -989,14 +973,14 @@ onUnmounted(() => {
|
||||
/>
|
||||
</NSpace>
|
||||
<span>
|
||||
<NRadioGroup v-model:value="settings.giftFilterType" :disabled="!configCanEdit">
|
||||
<NRadioGroup v-model:value="settings.giftFilterType" :disabled="!configCanEdit" @update:value="updateSettings">
|
||||
<NRadioButton :value="QueueGiftFilterType.And"> 需同时满足礼物名和价格 </NRadioButton>
|
||||
<NRadioButton :value="QueueGiftFilterType.Or"> 礼物名/价格 二选一 </NRadioButton>
|
||||
</NRadioGroup>
|
||||
</span>
|
||||
<NCheckbox v-model:checked="settings.allowIncreasePaymentBySendGift" @update:checked="updateSettings" :disabled="!configCanEdit"> 在队列中时继续发送礼物会叠加 </NCheckbox>
|
||||
<NCheckbox v-model:checked="settings.allowIncreasePaymentBySendGift" @update:checked="updateSettings" :disabled="!configCanEdit"> 在队列中时允许发送任意礼物来增加付费量 </NCheckbox>
|
||||
</template>
|
||||
<NCheckbox v-model:checked="settings.allowIncreasePaymentBySendGift" @update:checked="updateSettings" :disabled="!configCanEdit"> 在队列中时允许继续发送礼物累计付费量 (仅限上方设定的礼物) </NCheckbox>
|
||||
<NCheckbox v-model:checked="settings.allowIncreasePaymentBySendGift" @update:checked="updateSettings" :disabled="!configCanEdit"> 允许发送任意礼物来叠加付费量 </NCheckbox>
|
||||
</NSpace>
|
||||
<NDivider> 冷却 (单位: 秒) </NDivider>
|
||||
<NCheckbox v-model:checked="settings.enableCooldown" @update:checked="updateSettings" :disabled="!configCanEdit"> 启用排队冷却 </NCheckbox>
|
||||
|
||||
@@ -85,7 +85,6 @@ async function SendQuestion() {
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('发送失败')
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
isSending.value = false
|
||||
@@ -112,7 +111,7 @@ function OnFileListChange(files: UploadFileInfo[]) {
|
||||
}
|
||||
function getPublicQuestions() {
|
||||
isGetting.value = true
|
||||
QueryGetAPI<QAInfo[]>(QUESTION_API_URL + 'get-public', {
|
||||
QueryGetAPI<QAInfo[]>(QUESTION_API_URL() + 'get-public', {
|
||||
id: userInfo?.id,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -124,7 +123,6 @@ function getPublicQuestions() {
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error('获取公开提问失败')
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
isGetting.value = false
|
||||
|
||||
@@ -30,7 +30,7 @@ const errMessage = ref('')
|
||||
|
||||
async function get() {
|
||||
isLoading.value = true
|
||||
await QueryGetAPI<ScheduleWeekInfo[]>(SCHEDULE_API_URL + 'get', {
|
||||
await QueryGetAPI<ScheduleWeekInfo[]>(SCHEDULE_API_URL() + 'get', {
|
||||
id: props.userInfo?.id,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -42,7 +42,6 @@ async function get() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('加载失败')
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
@@ -45,20 +45,18 @@ const settings = ref<Setting_SongRequest>({} as Setting_SongRequest)
|
||||
|
||||
async function getSongRequestInfo() {
|
||||
try {
|
||||
const data = await QueryGetAPI<{ songs: SongRequestInfo[]; setting: Setting_SongRequest }>(SONG_REQUEST_API_URL + 'get-active-and-settings', {
|
||||
const data = await QueryGetAPI<{ songs: SongRequestInfo[]; setting: Setting_SongRequest }>(SONG_REQUEST_API_URL() + 'get-active-and-settings', {
|
||||
id: props.userInfo?.id,
|
||||
})
|
||||
if (data.code == 200) {
|
||||
return data.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
} catch (err) {}
|
||||
return {} as { songs: SongRequestInfo[]; setting: Setting_SongRequest }
|
||||
}
|
||||
async function getSongs() {
|
||||
isLoading.value = true
|
||||
await QueryGetAPI<SongsInfo[]>(SONG_API_URL + 'get', {
|
||||
await QueryGetAPI<SongsInfo[]>(SONG_API_URL() + 'get', {
|
||||
id: props.userInfo?.id,
|
||||
})
|
||||
.then((data) => {
|
||||
@@ -70,7 +68,6 @@ async function getSongs() {
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
message.error('加载失败')
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -88,7 +85,7 @@ async function requestSong(song: SongsInfo) {
|
||||
} else {
|
||||
if (props.userInfo) {
|
||||
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,
|
||||
song: song.key,
|
||||
})
|
||||
@@ -117,7 +114,6 @@ onMounted(async () => {
|
||||
}
|
||||
}, 1000)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
message.error('加载失败')
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user