Skip to content

Commit c82bd38

Browse files
committed
Update the menu path and type columns
1 parent f3f1ceb commit c82bd38

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

backend/app/admin/model/menu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class Menu(Base):
2424
id: Mapped[id_key] = mapped_column(init=False)
2525
title: Mapped[str] = mapped_column(String(50), comment='菜单标题')
2626
name: Mapped[str] = mapped_column(String(50), comment='菜单名称')
27-
path: Mapped[str] = mapped_column(String(200), comment='路由地址')
27+
path: Mapped[str | None] = mapped_column(String(200), comment='路由地址')
2828
sort: Mapped[int] = mapped_column(default=0, comment='排序')
2929
icon: Mapped[str | None] = mapped_column(String(100), default=None, comment='菜单图标')
30-
type: Mapped[int] = mapped_column(default=0, comment='菜单类型(0目录 1菜单 2按钮)')
30+
type: Mapped[int] = mapped_column(default=0, comment='菜单类型(0目录 1菜单 2按钮 3外链 4内嵌)')
3131
component: Mapped[str | None] = mapped_column(String(255), default=None, comment='组件路径')
3232
perms: Mapped[str | None] = mapped_column(String(100), default=None, comment='权限标识')
3333
status: Mapped[int] = mapped_column(default=1, comment='菜单状态(0停用 1正常)')

backend/app/admin/schema/menu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class MenuSchemaBase(SchemaBase):
1313

1414
title: str = Field(description='菜单标题')
1515
name: str = Field(description='菜单名称')
16-
path: str = Field(description='路由路径')
16+
path: str | None = Field(None, description='路由地址')
1717
parent_id: int | None = Field(None, description='菜单父级 ID')
1818
sort: int = Field(0, ge=0, description='排序')
1919
icon: str | None = Field(None, description='图标')
20-
type: MenuType = Field(MenuType.directory, description='菜单类型(0目录 1菜单 2按钮)')
20+
type: MenuType = Field(MenuType.directory, description='菜单类型(0目录 1菜单 2按钮 3外链 4内嵌)')
2121
component: str | None = Field(None, description='组件路径')
2222
perms: str | None = Field(None, description='权限标识')
2323
status: StatusType = Field(StatusType.enable, description='状态')

backend/common/enums.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class MenuType(IntEnum):
4444
directory = 0
4545
menu = 1
4646
button = 2
47+
link = 3
48+
embedded = 4
4749

4850

4951
class RoleDataRuleOperatorType(IntEnum):

0 commit comments

Comments
 (0)