tidy apis

This commit is contained in:
RockYang
2024-07-12 14:39:14 +08:00
parent a5ef4299ec
commit d1965deff1
32 changed files with 203 additions and 1574 deletions

View File

@@ -381,7 +381,7 @@ const initData = () => {
const fetchRunningJobs = () => {
// 获取运行中的任务
httpGet(`/api/sd/jobs?status=0`).then(res => {
httpGet(`/api/sd/jobs?finish=0`).then(res => {
const jobs = res.data
const _jobs = []
for (let i = 0; i < jobs.length; i++) {
@@ -409,7 +409,7 @@ const pageSize = ref(10)
// 获取已完成的任务
const fetchFinishJobs = (page) => {
loading.value = true
httpGet(`/api/sd/jobs?status=1&page=${page}&page_size=${pageSize.value}`).then(res => {
httpGet(`/api/sd/jobs?finish=1&page=${page}&page_size=${pageSize.value}`).then(res => {
if (res.data.length < pageSize.value) {
finished.value = true
}
@@ -474,7 +474,7 @@ const removeImage = (event, item) => {
message:
'此操作将会删除任务和图片,继续操作码?',
}).then(() => {
httpPost("/api/sd/remove", {id: item.id, img_url: item.img_url, user_id: userId.value}).then(() => {
httpGet("/api/sd/remove", {id: item.id, user_id: item.user}).then(() => {
showSuccessToast("任务删除成功")
}).catch(e => {
showFailToast("任务删除失败:" + e.message)
@@ -491,7 +491,7 @@ const publishImage = (event, item, action) => {
if (action === false) {
text = "取消发布"
}
httpPost("/api/sd/publish", {id: item.id, action: action}).then(() => {
httpGet("/api/sd/publish", {id: item.id, action: action, user_id: item.user}).then(() => {
showSuccessToast(text + "成功")
item.publish = action
}).catch(e => {