Browse Source

拼写错误修改

main
QM303176530 5 years ago
parent
commit
aef29b138d
  1. 2
      QMPlusServer/controller/api/sys_menu.go
  2. 24
      QMPlusServer/model/sysModel/sys_base_menu.go
  3. 4
      QMPlusServer/router/sys_user.go

2
QMPlusServer/controller/api/sys_menu.go

@ -163,7 +163,7 @@ func DeleteBaseMenu(c *gin.Context) {
// @Produce application/json
// @Param data body sysModel.SysBaseMenu true "更新菜单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/updateBaseMen [post]
// @Router /menu/updateBaseMenu [post]
func UpdateBaseMenu(c *gin.Context) {
var menu sysModel.SysBaseMenu
_ = c.ShouldBindJSON(&menu)

24
QMPlusServer/model/sysModel/sys_base_menu.go

@ -49,18 +49,18 @@ func (b *SysBaseMenu) DeleteBaseMenu(id float64) (err error) {
//更新路由
func (b *SysBaseMenu) UpdateBaseMenu() (err error) {
upDataMap := make(map[string]interface{})
upDataMap["parent_id"] = b.ParentId
upDataMap["path"] = b.Path
upDataMap["name"] = b.Name
upDataMap["hidden"] = b.Hidden
upDataMap["component"] = b.Component
upDataMap["title"] = b.Title
upDataMap["icon"] = b.Icon
upDataMap["sort"] = b.Sort
upDataMap["nick_name"] = b.Title
err = qmsql.DEFAULTDB.Where("id = ?", b.ID).Find(&SysBaseMenu{}).Updates(upDataMap).Error
err1 := qmsql.DEFAULTDB.Where("menu_id = ?", b.ID).Find(&[]SysMenu{}).Updates(upDataMap).Error
upDateMap := make(map[string]interface{})
upDateMap["parent_id"] = b.ParentId
upDateMap["path"] = b.Path
upDateMap["name"] = b.Name
upDateMap["hidden"] = b.Hidden
upDateMap["component"] = b.Component
upDateMap["title"] = b.Title
upDateMap["icon"] = b.Icon
upDateMap["sort"] = b.Sort
upDateMap["nick_name"] = b.Title
err = qmsql.DEFAULTDB.Where("id = ?", b.ID).Find(&SysBaseMenu{}).Updates(upDateMap).Error
err1 := qmsql.DEFAULTDB.Where("menu_id = ?", b.ID).Find(&[]SysMenu{}).Updates(upDateMap).Error
fmt.Printf("菜单修改时候,关联菜单err1:%v,err:%v", err1, err)
return err
}

4
QMPlusServer/router/sys_user.go

@ -2,12 +2,12 @@ package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitUserRouter(Router *gin.RouterGroup) {
UserRouter := Router.Group("user").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
UserRouter := Router.Group("user")
//.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
UserRouter.POST("changePassword", api.ChangePassword) // 修改密码
UserRouter.POST("uploadHeaderImg", api.UploadHeaderImg) //上传头像

Loading…
Cancel
Save