跳转正文

Auth Task ​

适用范围:Legacy Admin Kit / Schema 与旧 admin-vue。新 admin-nuxtui 的开发入口见管理端 Nuxt UI 指南。

Auth Task 由宿主 AuthLayout 与内容 surface YAuthTaskSurface 组成。Layout 负责全视口背景、外层内容和全局 footer;surface 负责 mark、标题、正文、feedback、actions 与 result anatomy。

什么时候使用 ​

  • 登录、注册、找回密码、重置密码、首次登录改密。
  • 需要 form、普通 content 或完成后的 result 呈现。

已登录后的账户设置或业务编辑任务不使用 Auth Task;它们应选择 Page Frame 或 Editor Task。

Anatomy ​

text
AuthLayout
├─ auth content
│  └─ YAuthTaskSurface
│     ├─ mark + title + description
│     ├─ form/content/result
│     ├─ feedback
│     └─ full-width actions
└─ auth footer

YAuthTaskSurface 的 submit 只转发原生任务意图,字段和请求流程仍由 feature 处理。错误反馈通过明确 input 进入 surface,不在 layout 中捕获或改写业务异常。

State owner ​

  • credentials、validation、challenge、API 请求:对应 auth feature。
  • route/query/redirect:Vue Router 与 feature。
  • session/authenticated identity:既有 auth/application runtime。
  • viewport、auth background、outer footer:AuthLayout。
  • form/content/result、feedback 与 action placement:YAuthTaskSurface。

不得把 challenge 或 route transition 编码进 shared surface,也不得由 Schema 另建一套 auth state machine。

真实 consumer ​

  • /auth/sign-in — src/app/account/sign-in/index.vue
  • /auth/forgot-password — src/app/account/forgot-password/index.vue
  • /auth/reset-password — src/app/account/reset-password/index.vue
  • /auth/register — src/app/account/register/index.vue
  • /auth/change-initial-password — src/app/account/change-initial-password/index.vue

这些 route 统一经 src/layouts/auth/AuthLayout.vue 渲染;feature 不应恢复通用 auth card/page/footer scoped CSS。

Feature 提供什么 ​

  • title、description、mode 与业务字段。
  • submit/action handler、loading disabled state 与业务 feedback。
  • 成功后的 route 或 result 决策。

组件使用入口见 Yoyo Admin 组件。

YoyoBoot · 从真实项目走向可复用能力