Skip to content
关注公众号,获取新课通知

删除礼物


控制器:app/controller/admin/gift.js

js
	async delete(){
        const { ctx, app } = this;
        const id = ctx.params.id
        await app.model.Gift.destroy({
            where:{ id }
        })
        ctx.toast('删除成功','success')

        ctx.redirect(`/admin/gift`);
    }

路由:app/router.js

js
router.get("/admin/gift/delete/:id", controller.admin.gift.delete);