//打开删除确认对话框
async deleteUser(id) {
console.log(id)
const res= await this.$confirm(‘此操作将永久删除该用户, 是否继续?’, ‘提示’, {
confirmButtonText: ‘确定’,
cancelButtonText: ‘取消’,
type: ‘warning’
}).catch(error=>error)
if(res!== 'confirm') {
return this.$message({
type: 'info',
message: '已取消删除'
});
}
//调接口删除
const res2=await deleteUserAPI(id)
//删除成功后刷新用户列表
this.getUserList()
},