Commit a3095a01 authored by chenqikuai's avatar chenqikuai

fix: 专辑删除

parent 977b966d
...@@ -46,37 +46,23 @@ const renameAlbum = (albumMsg: any) => { ...@@ -46,37 +46,23 @@ const renameAlbum = (albumMsg: any) => {
}; };
const deleteAlbum = async (item: any) => { const deleteAlbum = async (item: any) => {
const res = await $ajax({ showTip(
url: URLS.files, "确认删除此专辑及专辑内全部内容吗?删除后无法找回,请谨慎操作。",
type: "get", async () => {
params: { const ret = await $ajax({
category_id: item.id as string, url: URLS.categories,
page: 1, type: "delete",
page_size: 10, params: {
img_width: 70, ids: [item.id],
}, },
}); });
if (res?.code === 200 && res.data.total === 0) { console.log(ret, "show ret");
showTip( if (ret && ret!.code === 200) {
"确认删除此专辑及专辑内全部内容吗?删除后无法找回,请谨慎操作。", ElMessage.success("删除成功");
async () => { emit("update");
const ret = await $ajax({
url: URLS.categories,
type: "delete",
params: {
ids: [item.id],
},
});
console.log(ret, "show ret");
if (ret && ret!.code === 200) {
ElMessage.success("删除成功");
emit("update");
}
} }
); }
} else { );
showTip("请先将专辑内的藏品删除后,在删除专辑。", async () => {});
}
}; };
const confirmRename = async (name: string) => { const confirmRename = async (name: string) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment