标签管理前端友好提示

This commit is contained in:
王卓煜
2025-09-18 09:45:33 +08:00
parent 98ba239494
commit 0bba87cb3d

View File

@@ -236,8 +236,14 @@ export default {
const originalStatus = row.isHot;
try {
// 调用 API 更新状态
await apiCourseTag.changeTagHot(row);
this.$message.success('更新成功');
await apiCourseTag.changeTagHot(row).then((res)=>{
if (res.status == 200){
this.$message.success(res.message);
}else {
row.isHot=false;
this.$message.warning(res.message);
}
});
} catch (error) {
// 发生错误时回滚状态
row.isHot = originalStatus;