7159930d9c
## 新用户昵称 微信登录拿不到昵称(要用户主动授权),原来一律叫「微信用户」, 社区里一屏全是同名,后台也没法区分。改成随机生成「铲屎官12138」 这种形式:10 个前缀 × 5 位数字,落库前查重,撞了重试。 新增 users.nickname_auto 标记这个昵称是系统生成的。原来判断该不该 用微信授权昵称覆盖,靠的是「昵称是不是等于『微信用户』」这个字符串 比较,改成随机昵称后这招就失效了。有标记位才能安全覆盖,同时保证 用户自己改过的昵称不会被冲掉(改昵称时会把标记置 false)。 ## 用户管理 加「宠物档案」列,显示每个用户建了几个档。用一次 GROUP BY 查完 当页所有人,不是每行一次 count——那会是 N+1。 ## 帖子审核 加发布时间列。今天的显示「今天 14:48」,昨天的显示「昨天」, 更早的显示日期——审核时关心的是「多久以前发的」而不是完整时间戳。 ## 文章 新增 16 篇,连同原有 4 篇共 20 篇,每篇 400-570 字: 猫 5 篇(新猫到家第一周 / 猫砂盆 / 公猫尿闭 / 掉毛毛球 / 老年猫信号) 狗 5 篇(社会化关键期 / 定点排便 / 遛狗时长 / 刷牙 / 中暑防护) 通用 6 篇(体重趋势 / 驱虫周期 / 绝育 / 急诊清单 / 就医准备 / 养宠预算) 沿用和 AI 助手一样的安全护栏:不做诊断、不给药物剂量,凡是可能 延误病情的都写清「什么时候必须去医院」。犬用驱虫药对猫的致死风险 这类真实事故也写进去了。 seedArticles 从「库空才插」改成「按标题补缺失」,以后往内置清单加 文章,老库启动也能拿到。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
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.