chore: remove unused steering docs and update point settings model

This commit is contained in:
2025-10-16 00:52:05 +08:00
parent 26273a4afc
commit 55d3b31146
58 changed files with 2491 additions and 3480 deletions

View File

@@ -325,7 +325,7 @@ const sortedTodayTypes = computed(() => {
.sort(([, countA], [, countB]) => countB - countA)
})
type TodayTypeRow = {
interface TodayTypeRow {
key: string
rank: number
type: string
@@ -1036,9 +1036,9 @@ onUnmounted(() => {
:type="biliCookie.cookieCloudState === 'valid' ? 'success' : biliCookie.cookieCloudState === 'syncing' ? 'info' : biliCookie.cookieCloudState === 'invalid' ? 'error' : 'default'"
>
{{
biliCookie.cookieCloudState === 'valid' ? '已配置' :
biliCookie.cookieCloudState === 'syncing' ? '同步中' :
biliCookie.cookieCloudState === 'invalid' ? '配置无效' : '未配置'
biliCookie.cookieCloudState === 'valid' ? '已配置'
: biliCookie.cookieCloudState === 'syncing' ? '同步中'
: biliCookie.cookieCloudState === 'invalid' ? '配置无效' : '未配置'
}}
</NTag>
</template>

View File

@@ -1,8 +1,7 @@
<script setup lang="ts">
import ReadDanmaku from '@/views/open_live/ReadDanmaku.vue';
import ReadDanmaku from '@/views/open_live/ReadDanmaku.vue'
</script>
<template>
<ReadDanmaku />
</template>
<ReadDanmaku />
</template>

View File

@@ -211,8 +211,7 @@ const separatorOptions = [
>
<NGi>
<NFormItem label="背景颜色">
<NColorPicker
/>
<NColorPicker />
</NFormItem>
</NGi>
<NGi>

View File

@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { HistoryItem } from '../../store/autoAction/utils/historyLogger'
import { ArrowClockwise16Filled, CheckmarkCircle16Filled, Delete16Filled, DismissCircle16Filled } from '@vicons/fluent'
import {
NButton,
@@ -16,6 +17,8 @@ import {
NTooltip,
useMessage,
} from 'naive-ui'
import type { DataTableColumns } from 'naive-ui'
import { h, onMounted, onUnmounted, ref } from 'vue'
import { clearAllHistory, clearHistory, getHistoryByType, HistoryType } from '../../store/autoAction/utils/historyLogger'
@@ -40,7 +43,7 @@ const refreshInterval = 10000
let refreshTimer: number | null = null
// 列定义
const columns = [
const columns: DataTableColumns<HistoryItem> = [
{
title: '时间',
key: 'timestamp',
@@ -67,7 +70,7 @@ const columns = [
key: 'content',
ellipsis: {
tooltip: true,
},
} as const,
},
{
title: '目标',

View File

@@ -1,6 +1,7 @@
<script lang="ts" setup>
import type { DataTableColumns } from 'naive-ui'
import type { CheckInRankingInfo, CheckInResult } from '@/api/api-models'
import type { CheckInRankingInfo, CheckInResult, Setting_Point } from '@/api/api-models'
import { Info24Filled } from '@vicons/fluent'
import { NAlert, NButton, NCard, NDataTable, NDivider, NForm, NFormItem, NIcon, NInput, NInputGroup, NInputNumber, NPopconfirm, NSelect, NSpace, NSpin, NSwitch, NTabPane, NTabs, NText, NTime, NTooltip } from 'naive-ui'
import { computed, h, onMounted, ref } from 'vue'
@@ -38,9 +39,35 @@ const checkInPlaceholders = [
{ name: '{{checkin.time}}', description: '签到时间对象' },
]
// 服务端签到设置
const serverSetting = computed(() => {
return accountInfo.value?.settings?.point || {}
// 服务端签到设置(提供强类型默认值,避免模板中访问属性时报错)
const defaultPointSetting: Setting_Point = {
allowType: [],
jianzhangPoint: 0,
tiduPoint: 0,
zongduPoint: 0,
giftPercentMap: {},
scPointPercent: 0,
giftPointPercent: 0,
giftAllowType: 0,
shouldDiscontinueWhenSoldOut: false,
enableCheckIn: false,
checkInKeyword: '',
givePointsForCheckIn: false,
baseCheckInPoints: 0,
enableConsecutiveBonus: false,
bonusPointsPerDay: 0,
maxBonusPoints: 0,
allowSelfCheckIn: false,
requireAuth: false,
enableDailyFirstDanmaku: false,
dailyFirstDanmakuPoints: 5,
enableDailyFirstGift: false,
dailyFirstGiftPoints: 10,
useDailyFirstGiftPercent: false,
dailyFirstGiftPercent: 0.1,
}
const serverSetting = computed<Setting_Point>(() => {
return (accountInfo.value?.settings?.point ?? defaultPointSetting)
})
// 是否可以编辑设置
@@ -184,12 +211,12 @@ const rankingColumns: DataTableColumns<CheckInRankingInfo> = [
{
title: '连续签到天数',
key: 'consecutiveDays',
sorter: 'default',
sorter: true,
},
{
title: '积分',
key: 'points',
sorter: 'default',
sorter: true,
},
{
title: '最近签到时间',
@@ -204,7 +231,7 @@ const rankingColumns: DataTableColumns<CheckInRankingInfo> = [
default: () => new Date(row.lastCheckInTime).toLocaleString(),
})
},
sorter: 'default',
sorter: true,
},
{
title: '已认证',

View File

@@ -144,7 +144,7 @@ export function useDanmakuUtils(
const emojiInfo = (availableEmojis.inline?.[emojiFullName]
?? availableEmojis.inline?.[emojiName]
?? availableEmojis.plain?.[emojiFullName]
?? availableEmojis.plain?.[emojiName]) as string | undefined
?? availableEmojis.plain?.[emojiName])
if (emojiInfo) {
// 找到了表情

View File

@@ -37,7 +37,7 @@ let updateNotificationRef: any = null
async function sendHeartbeat() {
try {
await invoke('heartbeat', undefined, {
headers: [['Origin', location.host]]
headers: [['Origin', location.host]],
})
} catch (error) {
console.error('发送心跳失败:', error)
@@ -439,7 +439,7 @@ export async function callStartDanmakuClient() {
if (settings.settings.useDanmakuClientType === 'direct') {
info('开始初始化弹幕客户端 [direct]')
const key = await getRoomKey(
accountInfo.value.biliRoomId!,
accountInfo.value.biliRoomId,
await biliCookie.getBiliCookie() || '',
)
if (!key) {
@@ -452,10 +452,10 @@ export async function callStartDanmakuClient() {
return { success: false, message: '无法获取buvid' }
}
return webFetcher.Start('direct', {
roomId: accountInfo.value.biliRoomId!,
roomId: accountInfo.value.biliRoomId,
buvid: buvid.data,
token: key,
tokenUserId: biliCookie.uId!,
tokenUserId: biliCookie.uId,
}, true)
} else {
info('开始初始化弹幕客户端 [openlive]')

View File

@@ -259,7 +259,7 @@ export function executeActions(
// 更新冷却时间
runtimeState.lastExecutionTime[action.id] = Date.now()
const sendAction = async () => sendAndLogDanmaku(handlers.sendLiveDanmaku!, action, roomId, message)
const sendAction = async () => sendAndLogDanmaku(handlers.sendLiveDanmaku, action, roomId, message)
// 延迟发送
if (action.actionConfig.delaySeconds && action.actionConfig.delaySeconds > 0) {
@@ -285,7 +285,7 @@ export function executeActions(
runtimeState.lastExecutionTime[action.id] = Date.now()
const sendPmPromise = async (uid: number, msg: string) => {
return handlers.sendPrivateMessage!(uid, msg)
return handlers.sendPrivateMessage(uid, msg)
.then((success) => {
// 记录私信发送历史
logPrivateMsgHistory(

View File

@@ -1,6 +1,6 @@
import type {
AutoActionItem,
RuntimeState
RuntimeState,
} from './autoAction/types.js'
import type { EventModel } from '@/api/api-models.js'
import { useIDBKeyval } from '@vueuse/integrations/useIDBKeyval'
@@ -141,7 +141,7 @@ export const useAutoAction = defineStore('autoAction', () => {
runtimeState.value.lastExecutionTime[actionToExecute.id] = Date.now()
if (actionToExecute.actionConfig.delaySeconds && actionToExecute.actionConfig.delaySeconds > 0) {
setTimeout(() => {
biliFunc.sendLiveDanmaku(roomId.value!, formattedContent).catch(err => console.error('[AutoAction] 发送弹幕失败:', err))
biliFunc.sendLiveDanmaku(roomId.value, formattedContent).catch(err => console.error('[AutoAction] 发送弹幕失败:', err))
}, actionToExecute.actionConfig.delaySeconds * 1000)
} else {
biliFunc.sendLiveDanmaku(roomId.value, formattedContent).catch(err => console.error('[AutoAction] 发送弹幕失败:', err))
@@ -251,7 +251,7 @@ export const useAutoAction = defineStore('autoAction', () => {
runtimeState.value.lastExecutionTime[currentAction.id] = Date.now()
if (currentAction.actionConfig.delaySeconds && currentAction.actionConfig.delaySeconds > 0) {
setTimeout(() => {
biliFunc.sendLiveDanmaku(roomId.value!, formattedContent).catch(err => console.error('[AutoAction] 发送弹幕失败:', err))
biliFunc.sendLiveDanmaku(roomId.value, formattedContent).catch(err => console.error('[AutoAction] 发送弹幕失败:', err))
}, currentAction.actionConfig.delaySeconds * 1000)
} else {
biliFunc.sendLiveDanmaku(roomId.value, formattedContent).catch(err => console.error('[AutoAction] 发送弹幕失败:', err))
@@ -705,7 +705,7 @@ export const useAutoAction = defineStore('autoAction', () => {
if (action.actionConfig.delaySeconds && action.actionConfig.delaySeconds > 0) {
console.log(`[定时任务测试] 将在 ${action.actionConfig.delaySeconds} 秒后发送弹幕`)
setTimeout(() => {
biliFunc.sendLiveDanmaku(roomId.value!, formattedContent)
biliFunc.sendLiveDanmaku(roomId.value, formattedContent)
.catch(err => console.error('[AutoAction] 发送弹幕失败:', err))
}, action.actionConfig.delaySeconds * 1000)
} else {

View File

@@ -21,7 +21,7 @@ export class StoreTarget<T> {
if (result === undefined && this.defaultValue !== undefined) {
await this.set(this.defaultValue)
return this.defaultValue as T
return this.defaultValue
}
return result
}