feat: 添加签到功能及相关设置

- 更新 .gitignore,添加 SpecStory 说明文件
- 在 App.vue 中引入 NGlobalStyle 组件
- 更新 api-models.ts,添加签到相关数据模型
- 在 CheckInSettings.vue 中实现签到功能的配置界面
- 添加签到排行榜功能,允许用户查看签到情况
- 更新 PointHistoryCard.vue,增加签到记录显示
- 在 PointSettings.vue 中添加签到相关设置项
- 更新路由,添加签到排行页面
This commit is contained in:
2025-05-01 08:18:58 +08:00
parent 6160c89c68
commit f525bbb759
20 changed files with 1479 additions and 761 deletions

View File

@@ -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
}

View File

@@ -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<T>(