2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 22:07:16 +08:00

feat: alova.js替换axios

This commit is contained in:
耗子
2025-02-09 02:10:17 +08:00
parent 23b13ff79d
commit 6ac5e63684
5 changed files with 58 additions and 86 deletions

View File

@@ -1,17 +1,17 @@
import { request } from '@/utils'
import { http } from '@/utils'
export default {
// 获取任务列表
list: (page: number, limit: number): any => request.get('/cron', { params: { page, limit } }),
list: (page: number, limit: number): any => http.Get('/cron', { params: { page, limit } }),
// 获取任务脚本
get: (id: number): any => request.get('/cron/' + id),
get: (id: number): any => http.Get('/cron/' + id),
// 创建任务
create: (task: any): any => request.post('/cron', task),
create: (task: any): any => http.Post('/cron', task),
// 修改任务
update: (id: number, name: string, time: string, script: string): any =>
request.put('/cron/' + id, { name, time, script }),
http.Put('/cron/' + id, { name, time, script }),
// 删除任务
delete: (id: number): any => request.delete('/cron/' + id),
delete: (id: number): any => http.Delete(`/cron/${id}`),
// 修改任务状态
status: (id: number, status: boolean): any => request.post('/cron/' + id + '/status', { status })
status: (id: number, status: boolean): any => http.Post('/cron/' + id + '/status', { status })
}