修复管理员无法删除项目的BUG

This commit is contained in:
Minho 2017-06-09 13:25:39 +08:00
parent 028f6b3690
commit 33ad75a088
3 changed files with 4 additions and 2 deletions

View File

@ -636,6 +636,7 @@ func (c *BookController) SaveSort() {
func (c *BookController) IsPermission() (*models.BookResult,error) {
identify := c.GetString("identify")
book ,err := models.NewBookResult().FindByIdentify(identify,c.Member.MemberId)
if err != nil {

View File

@ -23,6 +23,7 @@ func init() {
beego.Router("/manager/member/change-member-role", &controllers.ManagerController{},"post:ChangeMemberRole")
beego.Router("/manager/books", &controllers.ManagerController{},"*:Books")
beego.Router("/manager/books/edit/:key", &controllers.ManagerController{},"*:EditBook")
beego.Router("/manager/books/delete", &controllers.ManagerController{},"*:DeleteBook")
beego.Router("/manager/comments", &controllers.ManagerController{},"*:Comments")
beego.Router("/manager/books/token", &controllers.ManagerController{},"post:CreateToken")
beego.Router("/manager/setting",&controllers.ManagerController{},"*:Setting")

View File

@ -165,8 +165,8 @@
<!-- Delete Book Modal -->
<div class="modal fade" id="deleteBookModal" tabindex="-1" role="dialog" aria-labelledby="deleteBookModalLabel">
<div class="modal-dialog" role="document">
<form method="post" id="deleteBookForm" action="{{urlfor "BookController.Delete"}}">
<input type="hidden" name="identify" value="{{.Model.Identify}}">
<form method="post" id="deleteBookForm" action="{{urlfor "ManagerController.DeleteBook"}}">
<input type="hidden" name="book_id" value="{{.Model.Bookid}}">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>