On this page
删除用户
控制器:app/controller/admin/user.js
js
async delete(){
const { ctx, app } = this;
const id = ctx.params.id
await app.model.User.destroy({
where:{
id
}
})
ctx.toast('删除成功','success')
ctx.redirect(`/admin/user`);
}
路由:app/router.js
js
router.get("/admin/user/delete/:id", controller.admin.user.delete);