Files
ops2/.workbuddy/memory/2026-04-01.md
T
2026-04-01 14:17:35 +08:00

53 lines
2.9 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.
# 2026-04-01 工作日志
## 修复 SQLite CGO 启动报错 ✅ (11:20)
- **问题**fresh 启动时报 `CGO_ENABLED=0` 导致 go-sqlite3 无法工作
- **原因**fresh 不是通过 run-dev.bat 启动,没有继承 `CGO_ENABLED=1` 环境变量
- **修复**
- 更新 `run-dev.bat`:改为用 fresh 启动,并确保 `set CGO_ENABLED=1` 在 fresh 之前执行
- 更新 `start-dev.bat`:同样加上 `set CGO_ENABLED=1`
- 创建 `runner.conf`fresh 配置文件)
- **正确启动方式**:在 backend/ 目录执行 `.\run-dev.bat`,或 PowerShell 中设置 `$env:CGO_ENABLED="1"``go run .`
- **GCC 问题**:已安装 TDM-GCC v10.3.0
- **Fresh 问题**runner-build.exe 缓存损坏,已清理并改用 `go run .` 启动
## 为 AccountView.vue 添加中文注释 ✅ (12:43)
-`frontend/ops_vue_js/src/views/settings/AccountView.vue` 添加完整的中文注释
- 包含:导入说明、响应式变量说明、函数功能说明、模板结构说明
- 未改变任何代码逻辑,仅添加注释
## 为 ContactView.vue 添加中文注释 ✅ (13:36)
-`frontend/ops_vue_js/src/views/settings/ContactView.vue` 添加完整的中文注释
- 包含:导入说明、表单数据说明、handleChangeEmail 函数详细注释
- 模板结构说明(页面布局、邮箱输入、验证提示、按钮交互)
- 未改变任何代码逻辑
## 后端入口迁移:cmd/ops-server/main.go → 根目录 main.go ✅ (11:05)
- 将新架构 `cmd/ops-server/main.go` 内容合并到根目录 `backend/main.go`
- 删除 `cmd/` 目录
- 更新 `run-dev.bat``start-dev.bat` 启动命令从 `go run ./cmd/ops-server/main.go` 改为 `go run .`
- 编译验证通过(0 errors
- 现在直接在 `backend/` 目录下运行 `go run .` 即可启动
## 为 ScheduleView.vue 添加今天(Today)按钮 ✅ (13:50)
- 修改 `frontend/ops_vue_js/src/views/scheduleView.vue` 的 headerToolbar 配置
- 在 left 区域加入 `today` 按钮:`prevYear,prev,today,next,nextYear`
- 在 customButtons 中添加 today 按钮功能实现:`click() { calendarRef.value.getApi().today() }`
- 修复中英文语言文件中 `tody` 键名的拼写错误,改为正确的 `today`
- 更新 today 按钮文本引用为正确的键名 `t('schedule.today')`
- 所有代码编译通过,无语法错误
## 修复 ScheduleView.vue 中的 TypeError 错误 ✅ (14:07)
- **问题**`Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'prevYear') at ScheduleView.vue:79:53`
- **原因**`watch` 函数中访问路径错误,使用了 `calendarOptions.value.headerToolbar.customButtons`,但实际应该是 `calendarOptions.value.customButtons`
- **修复**
-`calendarOptions.value.headerToolbar.customButtons` 改为 `calendarOptions.value.customButtons`
-`watch` 函数中添加 today 按钮的文本更新逻辑:`calendarOptions.value.customButtons.today.text = t('schedule.today')`
- 修复后错误消失,代码正常运行