refactor: vue3 axios api ...

This commit is contained in:
xingyu
2022-07-19 22:33:54 +08:00
parent ba96eef51a
commit 9e2e220b69
121 changed files with 1022 additions and 9700 deletions

View File

@@ -1,27 +1,29 @@
import { defHttp } from '@/config/axios'
import { useAxios } from '@/hooks/web/useAxios'
import type { NoticeVO } from './types'
const request = useAxios()
// 查询公告列表
export const getNoticePageApi = ({ params }) => {
return defHttp.get<PageResult<NoticeVO>>({ url: '/system/notice/page', params })
export const getNoticePageApi = (params) => {
return request.get({ url: '/system/notice/page', params })
}
// 查询公告详情
export const getNoticeApi = (id: number) => {
return defHttp.get<NoticeVO>({ url: '/system/notice/get?id=' + id })
return request.get({ url: '/system/notice/get?id=' + id })
}
// 新增公告
export const createNoticeApi = (params: NoticeVO) => {
return defHttp.post({ url: '/system/notice/create', params })
export const createNoticeApi = (data: NoticeVO) => {
return request.post({ url: '/system/notice/create', data })
}
// 修改公告
export const updateNoticeApi = (params: NoticeVO) => {
return defHttp.put({ url: '/system/notice/update', params })
export const updateNoticeApi = (data: NoticeVO) => {
return request.put({ url: '/system/notice/update', data })
}
// 删除公告
export const deleteNoticeApi = (id: number) => {
return defHttp.delete({ url: '/system/notice/delete?id=' + id })
return request.delete({ url: '/system/notice/delete?id=' + id })
}