Remove deprecated item

This commit is contained in:
the1812 2025-02-12 08:29:06 +08:00
parent 67b720ed62
commit a92863ec8c

View File

@ -1,6 +1,6 @@
import { postTextWithCredentials, getJsonWithCredentials } from '@/core/ajax'
import { postTextWithCredentials } from '@/core/ajax'
import { Toast } from '@/core/toast'
import { formData, getCsrf } from '@/core/utils'
import { getCsrf } from '@/core/utils'
import { registerAndGetData } from '@/plugins/data'
export interface CheckInItem {
@ -19,7 +19,7 @@ const builtInItems: CheckInItem[] = [
const seedsToCoinsApi = 'https://api.live.bilibili.com/xlive/revenue/v1/wallet/silver2coin'
const text = await postTextWithCredentials(
seedsToCoinsApi,
formData({
new URLSearchParams({
csrf: getCsrf(),
csrf_token: getCsrf(),
}),
@ -40,31 +40,5 @@ const builtInItems: CheckInItem[] = [
}
},
},
{
name: 'live-check-in',
displayName: '直播间签到',
icon: 'mdi-calendar-check',
action: async () => {
const liveCheckInApi = 'https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/DoSign'
const json = (await getJsonWithCredentials(liveCheckInApi)) as {
code: number
message: string
data: {
text: string
specialText: string
allDays: number
hadSignDays: number
isBonusDay: number
}
}
if (json.code !== 0) {
Toast.info(json.message, '直播间签到', 3000)
} else {
const { text, specialText, allDays, hadSignDays } = json.data
const message = `签到成功, 获得了${text} ${specialText}\n本月进度: ${hadSignDays} / ${allDays}`
Toast.success(message, '直播间签到', 3000)
}
},
},
]
export const [checkInItems] = registerAndGetData('checkInCenter.items', builtInItems)