newadmin
This commit is contained in:
parent
9c405513f4
commit
eea20a2a23
@ -47,7 +47,7 @@ export const batchDeleteShop = (ids) => {
|
|||||||
};
|
};
|
||||||
// 获取店铺数据
|
// 获取店铺数据
|
||||||
export const getListShop = () => {
|
export const getListShop = () => {
|
||||||
return instance.get(`/shop/getList`);
|
return instance.get(`/shop/list`);
|
||||||
};
|
};
|
||||||
// 更新同步订单状态
|
// 更新同步订单状态
|
||||||
export const updateSyncOrderStatus = (id, isSynOrder) => {
|
export const updateSyncOrderStatus = (id, isSynOrder) => {
|
||||||
|
|||||||
@ -394,27 +394,51 @@ const submitForm = () => {
|
|||||||
fastMailFormRef.value?.validate(async (valid) => {
|
fastMailFormRef.value?.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
|
let isSuccess = false;
|
||||||
|
|
||||||
if (form.value.id) {
|
if (form.value.id) {
|
||||||
await fastMailApi.updateFastMail(form.value).finally(() => { buttonLoading.value = false; });
|
try {
|
||||||
|
await fastMailApi.updateFastMail(form.value);
|
||||||
|
ElMessage.success("操作成功");
|
||||||
|
isSuccess = true;
|
||||||
|
} catch (error) {
|
||||||
|
console.log("捕获到错误:", error);
|
||||||
|
if (error.name === 'BusinessError') {
|
||||||
|
ElMessage.error(error.message || "操作失败");
|
||||||
} else {
|
} else {
|
||||||
|
ElMessage.error("网络错误,请稍后重试");
|
||||||
const newadd= await fastMailApi.addFastMail(form.value);
|
}
|
||||||
debugger;
|
} finally {
|
||||||
console.log(newadd);
|
buttonLoading.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
const newadd = await fastMailApi.addFastMail(form.value);
|
||||||
|
console.log("111111", newadd);
|
||||||
if (newadd.code === 200 && newadd.data) {
|
if (newadd.code === 200 && newadd.data) {
|
||||||
ElMessage.success("操作成功")
|
ElMessage.success("操作成功");
|
||||||
}else{
|
isSuccess = true;
|
||||||
ElMessage.confirm(res.test)
|
} else {
|
||||||
|
ElMessage.error(newadd.message || "操作失败");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("捕获到错误:", error);
|
||||||
|
if (error.name === 'BusinessError') {
|
||||||
|
ElMessage.error(error.message || "操作失败");
|
||||||
|
} else {
|
||||||
|
ElMessage.error("网络错误,请稍后重试");
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
buttonLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// proxy.$modal.msgSuccess("操作成功");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 只有操作成功时才关闭弹框和刷新列表
|
||||||
|
if (isSuccess) {
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
await getList();
|
await getList();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user