diff --git a/.workbuddy/expert-history.json b/.workbuddy/expert-history.json index 4b7f073..748bb68 100644 --- a/.workbuddy/expert-history.json +++ b/.workbuddy/expert-history.json @@ -20,7 +20,29 @@ "usedAt": 1774930519865, "industryId": "02-Engineering" } + ], + "11397ece53fd4169b02f239520effebb": [ + { + "expertId": "BackendArchitect", + "name": "Joy", + "profession": "后端架构师", + "avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/BackendArchitect/BackendArchitect.png", + "promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/BackendArchitect/BackendArchitect_zh.md", + "usedAt": 1775021430911, + "industryId": "all" + } + ], + "289fb4d7478e42e594de7f5ef79758e6": [ + { + "expertId": "BackendArchitect", + "name": "Joy", + "profession": "后端架构师", + "avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/BackendArchitect/BackendArchitect.png", + "promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/BackendArchitect/BackendArchitect_zh.md", + "usedAt": 1775021430911, + "industryId": "all" + } ] }, - "lastUpdated": 1775015525304 + "lastUpdated": 1775021780833 } \ No newline at end of file diff --git a/.workbuddy/memory/2026-04-01.md b/.workbuddy/memory/2026-04-01.md index 82a9d94..3b8cd88 100644 --- a/.workbuddy/memory/2026-04-01.md +++ b/.workbuddy/memory/2026-04-01.md @@ -12,6 +12,19 @@ - **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` @@ -19,3 +32,21 @@ - 更新 `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')` +- 修复后错误消失,代码正常运行 diff --git a/backend/my_work/routers/apiUsers.go b/backend/my_work/routers/apiUsers.go index f5d6337..e576ad4 100644 --- a/backend/my_work/routers/apiUsers.go +++ b/backend/my_work/routers/apiUsers.go @@ -63,7 +63,7 @@ type From_user_add struct { type From_user_login struct { Username string `json:"username"` - Userpass string `json:"userpass"` + Password string `json:"password"` Remember bool `json:"remember"` } @@ -261,18 +261,26 @@ func ApiUser(r *gin.RouterGroup) { } } - if is_save_ok { - //修改数据库内容 - var user_info_fund models.TabUserInfo_ - user_info_fund.UserID = user.ID + if is_save_ok { + //修改数据库内容 + var user_info_fund models.TabUserInfo_ + user_info_fund.UserID = user.ID - var user_update_avatar models.TabUserInfo_ - user_update_avatar.AvatarPath = file_hashi_name + file_extname - - models.DB.Where(&user_info_fund).Updates(&user_update_avatar) + var user_update_avatar models.TabUserInfo_ + user_update_avatar.AvatarPath = file_hashi_name + file_extname + //先查找是否有记录 + if models.DB.Where(&user_info_fund).First(&user_info_fund).Error == nil { + //有记录,更新 + models.DB.Model(&user_info_fund).Updates(&user_update_avatar) + } else { + //无记录,创建 + user_update_avatar.UserID = user.ID + models.DB.Create(&user_update_avatar) } + } + } else { ReturnJson(ctx, "postErr", nil) } @@ -371,54 +379,6 @@ func ApiUser(r *gin.RouterGroup) { ReturnJson(ctx, "apiOK", redata) } - // _, cookieval := SeparateData(ctx) - // //fmt.Println("cookieis" + cookieval) - // if cookieval != "" { - // cookie := models.TabCookie_{ - // Value: cookieval, - // } - // if models.DB.Where(&cookie).First(&cookie).Error == nil { - // //找到cookie,验证cookie有效性,以及更新cookie - // if models.CheckCookiesAndUpdate(&cookie) { - // //cookie有效 - // //返回最新cookie - // redata := map[string]interface{}{ - // "cookie": cookie, - // } - // //载入用户info - // userInfo := models.TabFileInfo_{ - // UserID: cookie.UserID, - // } - // if models.DB.Where(&userInfo).First(&userInfo).Error == nil { - // redata["userInfo"] = userInfo - // } else { - // redata["userInfo"] = nil - // } - - // //载入user - // user := models.TabUser_{ - // ID: cookie.UserID, - // } - // models.DB.Where(&user).First(&user) - // user.Pass = "" - // user.Salt = "" - - // redata["user"] = user - - // ReturnJson(ctx, "apiOK", redata) - - // } else { - // ReturnJson(ctx, "userCookieExpired", nil) - // } - - // } else { - // ReturnJson(ctx, "userCookieNotFund", nil) - // } - - // } else { - // ReturnJson(ctx, "userCookieError", nil) - // } - }) //用户登陆 r.POST("/login", func(ctx *gin.Context) { @@ -426,7 +386,7 @@ func ApiUser(r *gin.RouterGroup) { data, _ := SeparateData(ctx) if data != nil { if err := mapstructure.Decode(data, &loginuser); err == nil { - if loginuser.Username != "" && loginuser.Userpass != "" { + if loginuser.Username != "" && loginuser.Password != "" { //传入的数据都ok,获取用户信息 getuser := models.TabUser_{ @@ -436,7 +396,7 @@ func ApiUser(r *gin.RouterGroup) { if models.DB.Where(&getuser).First(&getuser).Error == nil { //倒入数据 user := models.TabUser_{ - Pass: loginuser.Userpass, //密码明文 + Pass: loginuser.Password, //密码明文 Salt: getuser.Salt, //保存的盐制 } //哈希密 diff --git a/frontend/ops_vue_js/src/components/imageCropper.vue b/frontend/ops_vue_js/src/components/imageCropper.vue index 73e746f..bbcbdf2 100644 --- a/frontend/ops_vue_js/src/components/imageCropper.vue +++ b/frontend/ops_vue_js/src/components/imageCropper.vue @@ -285,7 +285,7 @@ function getsele() { -
+
diff --git a/frontend/ops_vue_js/src/i18n/en.json b/frontend/ops_vue_js/src/i18n/en.json index 8fb7f64..a31bccf 100644 --- a/frontend/ops_vue_js/src/i18n/en.json +++ b/frontend/ops_vue_js/src/i18n/en.json @@ -113,7 +113,7 @@ "no_events": "No events found", "delete_event": "Delete Event", "edit_event": "Edit Event", - "tody": "Today", + "today": "Today", "week": "This Week", "month": "This Month", "previous_month": "Prev Month", diff --git a/frontend/ops_vue_js/src/i18n/zh-CN.json b/frontend/ops_vue_js/src/i18n/zh-CN.json index ca6afd3..9e9e40a 100644 --- a/frontend/ops_vue_js/src/i18n/zh-CN.json +++ b/frontend/ops_vue_js/src/i18n/zh-CN.json @@ -113,7 +113,7 @@ "no_events": "没有找到事件", "delete_event": "删除事件", "edit_event": "编辑事件", - "tody": "今天", + "today": "今天", "week": "本周", "month": "本月", "previous_month": "上月", diff --git a/frontend/ops_vue_js/src/views/scheduleView.vue b/frontend/ops_vue_js/src/views/scheduleView.vue index b620e1e..41fa4d3 100644 --- a/frontend/ops_vue_js/src/views/scheduleView.vue +++ b/frontend/ops_vue_js/src/views/scheduleView.vue @@ -37,7 +37,7 @@ const calendarOptions = ref({ }, headerToolbar: { - left: 'prevYear,prev,next,nextYear', + left: 'prevYear,prev,today,next,nextYear', center: 'title', right: '', }, @@ -51,14 +51,18 @@ const calendarOptions = ref({ text: t('schedule.next_year'), click() { calendarRef.value.getApi().nextYear() }, }, - prevMonth: { + prev: { text: t('schedule.previous_month'), click() { calendarRef.value.getApi().prev() }, }, - nextMonth: { + next: { text: t('schedule.next_month'), click() { calendarRef.value.getApi().next() }, }, + today: { + text: t('schedule.today'), + click() { calendarRef.value.getApi().today() }, + }, week: { text: t('schedule.week'), click() { calendarRef.value.getApi().changeView('timeGridWeek') }, @@ -66,19 +70,18 @@ const calendarOptions = ref({ }, events: [ - { title: 'Event1', date: '2025-11-10' }, - { title: 'Event2', date: '2025-11-15', end: '2025-11-17' }, - { title: 'Event3', date: '2025-11-20T10:30:00', end: '2025-11-20T12:30:00' }, + ], }) watch(locale, () => { calendarOptions.value.locale = locale.value - calendarOptions.value.headerToolbar.customButtons.prevYear.text = t('schedule.previous_year') - calendarOptions.value.headerToolbar.customButtons.nextYear.text = t('schedule.next_year') - calendarOptions.value.headerToolbar.customButtons.prevMonth.text = t('schedule.previous_month') - calendarOptions.value.headerToolbar.customButtons.nextMonth.text = t('schedule.next_month') - calendarOptions.value.headerToolbar.customButtons.week.text = t('schedule.week') + calendarOptions.value.customButtons.prevYear.text = t('schedule.previous_year') + calendarOptions.value.customButtons.nextYear.text = t('schedule.next_year') + calendarOptions.value.customButtons.prev.text = t('schedule.previous_month') + calendarOptions.value.customButtons.next.text = t('schedule.next_month') + calendarOptions.value.customButtons.today.text = t('schedule.today') + calendarOptions.value.customButtons.week.text = t('schedule.week') }) diff --git a/frontend/ops_vue_js/src/views/settings/AccountView.vue b/frontend/ops_vue_js/src/views/settings/AccountView.vue index e6cd1cc..07f5f54 100644 --- a/frontend/ops_vue_js/src/views/settings/AccountView.vue +++ b/frontend/ops_vue_js/src/views/settings/AccountView.vue @@ -1,32 +1,60 @@