新建协作单以前会把「上次选的礼包」自动填进礼包名(localStorage huya.collab.lastGift)。连开几单同一个礼包是省事,但每开一单都顶着上一次的 选择,稍不留神就按错礼包建单;而且这个自动值会被草稿自动保存吃进去, 下次打开又「恢复」出来。 - 新建弹窗**不再预填礼包名**:删掉 lastGift 的读写,字段默认空白。 - 草稿恢复只带订单号 / 店铺 / CK / 截图 / 备注,礼包名留空; hasDraftContent() 也不再认「只有礼包名」的草稿(否则被旧逻辑自动填过的 那份草稿会一直弹「已恢复上次未提交的草稿」)。 - 新增 GET /external-orders/gifts/frequent:按台账里的使用次数排序 (次数相同看最近一次使用),新建与补资料弹窗在字段上方渲染最多 6 个按钮, 只显示**当前礼包缓存里还有的**(活动换 SID 后老礼包会整批下架)。 - 新增 5 例测试,并做了 3 次反向验证(去掉次数排序 / 改成升序 / 去掉空名过滤)。 补资料弹窗的初值仍是「这一单自己的礼包」,详情抽屉编辑也不动 —— 那不是 「上次选的」。
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint 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 ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])