Files
kintone-customize-manager/MEMORY.md
2026-03-17 16:05:22 +08:00

73 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MEMORY.md
## 2026-03-17 - GAIA_BL01 部署错误修复
### 遇到什么问题
- 用户点击部署时如果存在未修改的文件status: "unchanged"),会报错:`[404] [GAIA_BL01] 指定したファイルid: XXXXXが見つかりません。`
- 根本原因Kintone 的 `fileKey` 有两种类型:
- **临时 fileKey**Upload File API 生成3天有效**使用一次后失效**
- **永久 fileKey**:文件附加到记录时,永久有效
- 部署时 `getAppCustomize` 返回的 fileKey 是临时的,部署后就被消费
- 再次部署时使用已失效的 fileKey 就会报 GAIA_BL01 错误
### 如何解决的
修改 `src/main/ipc-handlers.ts` 中的 `registerDeploy` 函数:
1. 对于 "unchanged" 文件,不再使用前端传递的 `file.fileKey`
2. 改为从当前 Kintone 配置(`appDetail.customization`)中根据文件名匹配获取最新的 fileKey
3. 如果在当前配置中找不到该文件,抛出明确的错误提示用户刷新
### 以后如何避免
- Kintone API 返回的 fileKey 是临时的,每次部署后都会失效
- 部署时必须从当前 Kintone 配置获取最新的 fileKey而不是使用缓存的值
- 参考https://docs-customine.gusuku.io/en/error/gaia_bl01/
---
# MEMORY.md
## 2026-03-15 - CSS 模板字符串语法错误
### 遇到什么问题
- 在使用 `edit` 工具修改 `DomainForm.tsx` 中的 CSS 样式时,只替换了部分内容,导致 CSS 模板字符串语法错误
- 错误信息:`Unexpected token, expected ","``passwordHint` 定义处
- 原因:`.ant-form-item` 的 CSS 块没有正确关闭,缺少 `}` 和模板字符串结束符 `` ` ``
### 如何解决的
- 使用 `edit` 工具完整替换整个 `useStyles` 定义块,确保所有 CSS 模板字符串正确关闭
### 以后如何避免
- 修改 CSS-in-JS 样式时,尽量替换完整的样式块而非单行
- 修改后立即运行 `npx tsc --noEmit` 验证语法
- 注意模板字符串的开始 `` ` `` 和结束 `` ` `` 必须成对出现
---
## 2026-03-15 - UI 重构经验
### 变更内容
1. **DomainForm 表单间距**`marginMD``marginSM`
2. **AppDetail 头部布局**标题和按钮同一行flex 布局)
3. **AppDetail Tabs 重构**
- 移除 Tabs 组件
- 移除 "基本信息" tab
- 合并 4 个 JS/CSS tab 为单页面(选项 A单列滚动列表 + 分区标题)
- 新增 `viewMode` 状态管理列表/代码视图切换
- 点击文件进入代码视图,带返回按钮
### 文件修改
- `src/renderer/src/components/DomainManager/DomainForm.tsx`
- `src/renderer/src/components/AppDetail/AppDetail.tsx`
- `src/renderer/src/locales/zh-CN/app.json` - 添加 `backToList`
- `src/renderer/src/locales/en-US/app.json` - 添加 `backToList`
- `src/renderer/src/locales/ja-JP/app.json` - 添加 `backToList`