Files
ao3-mirror-ssr/src/stores/api.js
UnknownMp 8d248a44ff
All checks were successful
Build / build-and-test (push) Successful in 27s
增加设置板块, 允许自定义界面设置, 使用 VueUse 存储
[Style]
为主视图增加 16px 间距
更新 mdui-card 的右边距问题 (老问题了, 还是没有解决)

[Base]
引入 VueUse
分离 Axios
HTML 部分紧凑化
2025-05-23 22:41:47 +08:00

21 lines
515 B
JavaScript

import { defineStore } from 'pinia'
import { useApiRequest } from '../composables/apiRequest'
export const useApiStore = defineStore('api', () => {
async function getWork(workId, chapterId) {
const path = chapterId ? `work/${workId}/${chapterId}` : `work/${workId}`
const { execute } = useApiRequest('GET', path)
return await execute()
}
async function postData(url, payload) {
const { execute } = useApiRequest('POST', url, payload)
return await execute()
}
return {
getWork,
postData,
}
})