diff --git a/.gitignore b/.gitignore index efbe486..f5e69df 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ pnpm-debug.log* env.d.ts /.specstory /.cursor +# SpecStory explanation file +.specstory/.what-is-this.md diff --git a/README.md b/README.md index bfbdd4b..166f220 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,23 @@ ## Project setup ``` -yarn install +bun install ``` ### Compiles and hot-reloads for development ``` -yarn serve +bun dev ``` ### Compiles and minifies for production ``` -yarn build +bun run build ``` ### Lints and fixes files ``` -yarn lint +bun run lint ``` ### Customize configuration -See [Configuration Reference](https://cli.vuejs.org/config/). +See [Configuration Reference](https://cli.vuejs.org/config/). \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 98087e5..ff43eee 100644 --- a/src/App.vue +++ b/src/App.vue @@ -67,7 +67,8 @@ 'Inter ,"Noto Sans SC",-apple-system,blinkmacsystemfont,"Segoe UI",roboto,"Helvetica Neue",arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"!important', }, // ... - }; +}; + const body = document.body; onMounted(() => { if (isDarkMode.value) { @@ -84,6 +85,7 @@ style="height: 100vh" :locale="zhCN" :date-locale="dateZhCN" + inline-theme-disabled > @@ -93,6 +95,7 @@ + diff --git a/src/api/api-models.ts b/src/api/api-models.ts index d5df165..031c728 100644 --- a/src/api/api-models.ts +++ b/src/api/api-models.ts @@ -40,6 +40,7 @@ export interface UserInfo extends UserBasicInfo { isInBlackList: boolean templateTypes: { [key: string]: string } streamerInfo?: StreamerModel + allowCheckInRanking?: boolean // 是否允许查看签到排行 } } export interface EventFetcherStateModel { @@ -226,6 +227,18 @@ export interface Setting_Point { scPointPercent: number // double maps to number in TypeScript giftPointPercent: number // double maps to number in TypeScript giftAllowType: SettingPointGiftAllowType + + // 签到系统设置 + enableCheckIn: boolean // 是否启用签到功能 + checkInKeyword: string // 签到关键词 + givePointsForCheckIn: boolean // 是否为签到提供积分 + baseCheckInPoints: number // 基础签到积分 + enableConsecutiveBonus: boolean // 是否启用连续签到奖励 + bonusPointsPerDay: number // 每天额外奖励积分 + maxBonusPoints: number // 最大奖励积分 + allowSelfCheckIn: boolean // 是否允许自己签到 + requireAuth: boolean // 是否需要认证 + allowCheckInRanking: boolean // 是否允许查询签到排行 } export interface Setting_QuestionDisplay { font?: string // Optional string, with a maximum length of 30 characters @@ -801,7 +814,8 @@ export interface ResponsePointHisrotyModel { export enum PointFrom { Danmaku, Manual, - Use + Use, + CheckIn } export interface ResponseUserIndexModel { @@ -809,3 +823,24 @@ export interface ResponseUserIndexModel { videos: VideoCollectVideo[] links: { [key: string]: string } } + +// 签到排行信息 +export interface CheckInRankingInfo { + ouId: string + name: string + consecutiveDays: number + points: number + lastCheckInTime: number + isAuthed: boolean + monthlyCheckInCount?: number // 本月签到次数 + totalCheckInCount?: number // 总签到次数 +} + +// 签到结果 +export interface CheckInResult { + success: boolean + message: string + points: number + consecutiveDays: number + todayRank: number +} diff --git a/src/api/query.ts b/src/api/query.ts index 3c6c63b..a10dfee 100644 --- a/src/api/query.ts +++ b/src/api/query.ts @@ -142,9 +142,6 @@ function getParams(params: any) { resultParams.set('token', urlParams.get('token') || '') } - // 添加时间戳用于解决意外添加的缓存 - resultParams.set('timestamp', Date.now().toString()) - return resultParams.toString() } export async function QueryPostPaginationAPI( diff --git a/src/client/components/autoaction/ActionHistoryViewer.vue b/src/client/components/autoaction/ActionHistoryViewer.vue index 3c6d95e..485d676 100644 --- a/src/client/components/autoaction/ActionHistoryViewer.vue +++ b/src/client/components/autoaction/ActionHistoryViewer.vue @@ -34,6 +34,7 @@ const columns = [ title: '时间', key: 'timestamp', width: 180, + sorter: (a: HistoryItem, b: HistoryItem) => a.timestamp - b.timestamp, render: (row: HistoryItem) => { return h(NTime, { time: new Date(row.timestamp), @@ -106,9 +107,9 @@ async function loadHistory() { ]); historyData.value = { - [HistoryType.DANMAKU]: danmakuHistory, - [HistoryType.PRIVATE_MSG]: privateMsgHistory, - [HistoryType.COMMAND]: commandHistory + [HistoryType.DANMAKU]: danmakuHistory.sort((a, b) => b.timestamp - a.timestamp), + [HistoryType.PRIVATE_MSG]: privateMsgHistory.sort((a, b) => b.timestamp - a.timestamp), + [HistoryType.COMMAND]: commandHistory.sort((a, b) => b.timestamp - a.timestamp) }; } catch (error) { console.error('加载历史数据失败:', error); @@ -253,6 +254,7 @@ onUnmounted(() => { pageSizes: [10, 20, 50], }" :row-key="row => row.id" + default-sort-order="descend" >