handleDelete(index, row) {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
//返回一个promise当作then的参数
return reqDeleteUser(row.UserID)
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
//这个then是删除用户数据的
}).then(() => {
Message({
message: "操作成功",
type: "success",
duration: 5 * 1000,
});
const totalPage = Math.ceil((this.total - 1) / this.pagesize); // 总页数
// console.log(totalPage);
this.page = this.page > totalPage ? totalPage : this.page;
//发起请求数据因为不用处理接下来的数据
this.getData(this.page, this.pagesize);
let OperDesc = `删除了ID为${row.UserID},姓名为${row.UserName}的信息`;
//返回一个promise当作then的参数
return reqAddUserOperationLog({
OperModule2: "用户管理",
OperType: "删除",
OperDesc,
});
})
.catch((error) => {})
//日志的then
.then((res) => {
console.log("删除的日志res", res);
});
},
axios的then写法
最新推荐文章于 2025-03-31 10:23:48 发布