# Module Spec：store-routes（路由模式/菜单路由状态）

module:
  id: store-routes
  name: Routes Store（路由拦截/菜单路由设置）
  type: store
  entrypoints:
    - src/store/modules/routes.ts

public_api:
  concept:
    - "setRoutes(mode)：根据 authentication/rolesControl 生成可访问路由并 resetRouter"
    - "支持前端路由（asyncRoutes）与后端路由（getList -> convertRouter）两种模式"

dependency_closure:
  runtime:
    - "router：src/router（asyncRoutes/constantRoutes/resetRouter）"
    - "utils/routes：convertRouter/filterRoutes"
    - "api/router：getList（后端路由模式）"
    - "config：authentication/rolesControl"
    - "plugin-vab：gp.$baseMessage（后端路由格式异常提示）"

acceptance:
  - "前端路由模式下：setRoutes() 后 routes 可用于菜单渲染"
  - "后端路由模式下：getList 返回 list 后可 convertRouter 并 resetRouter"

pitfalls:
  - "后端路由 list 格式必须符合 convertRouter 预期；否则会提示错误"
