标签管理前端友好提示

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; const originalStatus = row.isHot;
try { try {
// 调用 API 更新状态 // 调用 API 更新状态
await apiCourseTag.changeTagHot(row); await apiCourseTag.changeTagHot(row).then((res)=>{
this.$message.success('更新成功'); if (res.status == 200){
this.$message.success(res.message);
}else {
row.isHot=false;
this.$message.warning(res.message);
}
});
} catch (error) { } catch (error) {
// 发生错误时回滚状态 // 发生错误时回滚状态
row.isHot = originalStatus; row.isHot = originalStatus;