mirror of
https://gitee.com/goflyfox/gmanager.git
synced 2025-12-06 09:19:03 +08:00
!1 fix:当菜单管理 新增目录的情况下,默认没有设置组件路径,导致基于这个目录下新建的菜单页面没有左边的导航栏。由于目前新增目录并没有设置组件…
* fix:当菜单管理 新增目录的情况下,默认没有设置组件路径,导致基于这个目录下新建的菜单页面没有左边的导航栏。由于目前新增目录并没有设置组件…
This commit is contained in:
@@ -7,6 +7,7 @@ toolchain go1.24.0
|
||||
require (
|
||||
github.com/goflyfox/gtoken/v2 v2.0.1
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.0
|
||||
github.com/gogf/gf/v2 v2.9.0
|
||||
github.com/mojocn/base64Captcha v1.3.8
|
||||
github.com/xuri/excelize/v2 v2.9.1
|
||||
@@ -23,7 +24,6 @@ require (
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-sql-driver/mysql v1.7.1 // indirect
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.0 // indirect
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
|
||||
@@ -3,9 +3,6 @@ package logic
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
v1 "gmanager/api/admin/v1"
|
||||
"gmanager/internal/admin/consts"
|
||||
"gmanager/internal/admin/dao"
|
||||
@@ -13,6 +10,10 @@ import (
|
||||
"gmanager/internal/admin/model/entity"
|
||||
input2 "gmanager/internal/admin/model/input"
|
||||
"gmanager/internal/library/gftoken"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
// Menu 菜单
|
||||
@@ -215,7 +216,7 @@ func (s *menu) Save(ctx context.Context, in *v1.MenuSaveReq) error {
|
||||
}
|
||||
}
|
||||
// 组件路径唯一性校验
|
||||
if model.Type != consts.MenuTypeButton && model.Component != "" {
|
||||
if model.Type != consts.MenuTypeButton && model.Type != consts.MenuTypeCatalog && model.Component != "" {
|
||||
componentCount, err := dao.Menu.Ctx(ctx).Where(dao.Menu.Columns().Component, model.Component).WhereNot(dao.Menu.Columns().Id, in.Id).Count()
|
||||
if err != nil {
|
||||
return gerror.Wrap(err, "检查组件路径唯一性失败")
|
||||
|
||||
@@ -469,6 +469,12 @@ function handleSubmit() {
|
||||
menuFormRef.value.validate((isValid: boolean) => {
|
||||
if (isValid) {
|
||||
const menuId = formData.value.id;
|
||||
if (formData.value.type === MenuTypeEnum.CATALOG) {
|
||||
// 如果是目录,在没有设置组件路径情况下,默认值是:Layout
|
||||
if (formData.value.component == undefined || formData.value.component == "") {
|
||||
formData.value.component = "Layout";
|
||||
}
|
||||
}
|
||||
if (menuId) {
|
||||
//修改时父级菜单不能为当前菜单
|
||||
if (formData.value.parentId == menuId) {
|
||||
|
||||
Reference in New Issue
Block a user