All checks were successful
Build / build-and-test (push) Successful in 27s
[Style] 为主视图增加 16px 间距 更新 mdui-card 的右边距问题 (老问题了, 还是没有解决) [Base] 引入 VueUse 分离 Axios HTML 部分紧凑化
21 lines
515 B
JavaScript
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,
|
|
}
|
|
})
|