Files
sundynix-pets/pets-be/web/admin
Blizzard 7acdf916d5 refactor(be): 养护模板也从代码里移出,只从数据库读
和文章同一个理由:模板是运营内容,不是代码。留一套内置默认还额外带来
一个坏处——库里配的和代码里写的会悄悄分叉,出问题时分不清用户拿到的
到底是哪一套。

删掉:
- builtinCat / builtinDog / builtinCareItems(8 套 × 96 条)
- SeedCareTemplates(启动时写内置默认)
- ResetCareTemplate + 后台「恢复默认」按钮 —— 已经没有默认可恢复

careTemplateItems 现在查不到就返回空。这意味着后台把某个组合配空了,
新用户会拿到一个什么都没有的首页而且不报错,所以 seedPetDefaults 里
加了一条 log:模板为空时打出 species/stage/petID,否则没人能发现。

「AI 生成草稿」原来在 AI 未开启或调用失败时静默返回内置默认,看起来
像是 AI 生成的。现在直接报错说清原因,让管理员知道要么开 AI 要么手填。

数据在库里,删代码不影响:预生产 8 套 96 条原样在,建档端到端复测通过
(3 月龄幼猫仍拿到「下一针疫苗·21 天后」,成年犬仍有疫苗驱虫提醒)。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 13:59:11 +08:00
..

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the Oxlint configuration

If you are developing a production application, we recommend enabling type-aware lint rules by installing oxlint-tsgolint and editing .oxlintrc.json:

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["react", "typescript", "oxc"],
  "options": {
    "typeAware": true
  },
  "rules": {
    "react/rules-of-hooks": "error",
    "react/only-export-components": ["warn", { "allowConstantExport": true }]
  }
}

See the Oxlint rules documentation for the full list of rules and categories.