Commit Graph

62 Commits

Author SHA1 Message Date
weli 8589f79e52 feat: auto-select default teacher on student login, redirect to teacher-select on org switch
- Add tryAutoSelect() to teacher store to pick first teacher when none selected
- Auto-select first teacher when student role is confirmed (both auto-login and manual role selection)
- Redirect students to /student/teacher-select after org switch, clearing previous teacher
- Covers: chooseRole(), single-role auto-login, and index page initialization

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 00:51:36 +08:00
weli e5e6de01d3 perf: parallelize independent requests in daka detail page
Use Promise.all for user group queries, comment loading,
and resource note group fetching.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 23:59:48 +08:00
weli 8589a6fc02 feat: student teacher switching in profile page
Add teacher context for students: show current teacher in profile,
allow switching via new teacher-select page. Filter daka queries
by selected teacher when available.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 23:50:39 +08:00
weli d117eb06f6 feat(course-package): detail page, publish/unpublish UI, edit lock
- Add detail/show page with conditional action buttons
- Route /course/course-package/detail with props query params
- List page click navigates to detail instead of edit
- Edit page redirects if package is published (published_at set)
- Store: add publish/unpublish API functions

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 21:06:19 +08:00
weli 8a8ce597b3 fix(pick): show my course groups tab in course-package picker
Course-package picker only showed org-visible groups, but supervisors
also need to see and use their own course groups. Add "我的课节" tab
for course-package mode.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 15:14:03 +08:00
weli 058e1b0a47 feat(course-package): add org_visible toggle and course-group picker
- CourseGroup: add org_visible field, teacher toggle on add/edit
- CoursePackage: add selectedGroups state, sync/list package items API
- Group picker: support COURSE_PACKAGE target, show org-visible groups

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 14:26:17 +08:00
weli b78f25da20 feat(course-package): add course-package CRUD pages under 教学资源库
Add list/add/edit views for course-package under the qumu section,
visible to TEACHER and SUPERVISOR roles via the 教学资源库 tab.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 13:51:27 +08:00
weli c3edff465b feat(org-home): render homepage markdown with signed images on teacher/student home
Made-with: Cursor
2026-04-28 10:45:11 +08:00
weli 4db9bc82c8 fix(org-homepage): sign upyun imgs in preview; strip failed upload placeholders
Made-with: Cursor
2026-04-28 09:46:48 +08:00
weli 925decd472 chore: vConsole logs for org homepage image compress upload
Made-with: Cursor
2026-04-28 08:32:17 +08:00
weli 1509bcbb99 fix(org): validate compress URL; register org_homepage in hty_resources
Made-with: Cursor
2026-04-28 08:25:09 +08:00
weli 6d74a34aa2 feat(org): homepage markdown image insert via compress pipeline
Made-with: Cursor
2026-04-28 08:07:34 +08:00
weli 1c59acc72b debug: 排课 clazz API 失败时输出 [ClazzApi]/[ClazzQuery] 到 vConsole
Made-with: Cursor
2026-04-28 00:41:28 +08:00
weli 27ce76bdfd fix(request): clazz API 使用 KC_SERVER/UC_SERVER 绝对 URL,避免相对路径落到错误 vhost 返回 HTML
Made-with: Cursor
2026-04-28 00:38:09 +08:00
weli fb7d15e6a1 fix: read course_id from route for course section list
WeChat webview can desync route query from route props; use useRoute for course_id and log API failures to console. Watch course_id to refetch when query changes.

Made-with: Cursor
2026-04-28 00:25:38 +08:00
weli 4f67165d59 fix: normalize course section resources to array
Sanitize course section resources payloads across list and id queries to avoid runtime filter/some failures from malformed resource shapes, with CourseSectionResourceDebug diagnostics.

Made-with: Cursor
2026-04-28 00:21:24 +08:00
weli 8977f13a05 fix: guard course section pagination payload shape
Normalize paged and list responses for course section APIs to prevent runtime errors on infinite scroll and emit CourseSectionPayloadDebug diagnostics for malformed payloads.

Made-with: Cursor
2026-04-28 00:19:23 +08:00
weli 7d4dd382b4 fix: guard clazz list payload shape with debug logs
Prevent runtime filter crashes in /clazz by normalizing API payloads to arrays and emitting ClazzPayloadDebug diagnostics when response shape is unexpected.

Made-with: Cursor
2026-04-28 00:17:02 +08:00
weli 98c0bfd195 refactor: rename clazz UI label to 排课
Use 排课 for /clazz tab and page titles to avoid confusion with teaching-domain 课程 terminology.

Made-with: Cursor
2026-04-28 00:15:33 +08:00
weli 543cab9ea7 fix: guard course list shape before filtering
Normalize find_all_courses response to an array and add page-level array fallback to prevent filter runtime errors when response payload is malformed.

Made-with: Cursor
2026-04-28 00:12:09 +08:00
weli 9f2ba95b1f fix: read org context from jwt sub claim payload
Parse current_org_id/current_org_role_keys from subject payload when tokens are encoded under claims.sub, so org switch context is correctly detected.

Made-with: Cursor
2026-04-28 00:05:49 +08:00
weli e15b68b16f chore(debug): add detailed org switch token diagnostics
Record before/after jwt org context decode details for org switch into console and localStorage, and surface actionable debug dialog when returned token lacks org context.

Made-with: Cursor
2026-04-28 00:03:00 +08:00
weli 713af27749 fix: harden org switch token validation and exit org page
Validate current_org_id from switch token before accepting it, align auth/sudo tokens, and force full navigation to home after switch to avoid staying on org-select state.

Made-with: Cursor
2026-04-27 23:59:56 +08:00
weli da9c365fc0 fix: avoid blocking org switch on full user refresh
After org switch, sync sudo token and navigate to home immediately instead of awaiting read() chain, preventing org select page from stalling.

Made-with: Cursor
2026-04-27 23:57:51 +08:00
weli d1caecd9e0 fix: decode org context from jwt payload robustly
Add base64 padding before atob when parsing token payload so current_org_id extraction no longer fails intermittently and loops users back to org select.

Made-with: Cursor
2026-04-27 23:55:24 +08:00
weli eb7c8e8831 fix: keep org context when refreshing user session
Avoid overwriting switched auth context with sudo2 token in read(); reuse Authorization as sudo token when current_org_id already exists.

Made-with: Cursor
2026-04-27 23:42:20 +08:00
weli 29262d67ec fix: align sudo token with switched auth org context
After org switch, set HtySudoerToken to the refreshed Authorization token so ws endpoints receive current_org_id instead of a sudo2 token without org context.

Made-with: Cursor
2026-04-27 23:40:16 +08:00
weli be5c4fa046 fix: refresh sudo token after org switch
Regenerate HtySudoerToken after switching organization so ws endpoints that read org context from sudo token no longer fail with current_org_id required.

Made-with: Cursor
2026-04-27 23:36:44 +08:00
weli 79a69719b1 fix: auto bootstrap org context outside index route
Ensure authenticated users without current_org_id are redirected or auto-switched before entering business routes, preventing global 500 errors after multi-organization rollout.

Made-with: Cursor
2026-04-27 23:32:48 +08:00
weli 0ea90bd282 feat(front): render organization homepage on role home pages
Show current organization homepage text on student and teacher home pages and provide fallback guidance when org is not selected.

Made-with: Cursor
2026-04-27 22:35:37 +08:00
weli 77f90b1948 fix(front): route legacy jihua notifications to daka pages
Avoid dead links after jihua route cleanup by redirecting related notification actions to daka flows with safe fallback behavior.

Made-with: Cursor
2026-04-27 22:06:33 +08:00
weli 02f39ddaf6 feat(front): add org context UI and role scoping
Introduce organization selection/homepage flows, show current organization on profile pages, and scope displayed roles to the active organization context while preserving system-wide behavior.

Made-with: Cursor
2026-04-27 21:52:26 +08:00
weli 80459e2b60 front: recover watermark url from DONE tasks or resubmit when missing result
Made-with: Cursor
2026-04-27 16:46:39 +08:00
weli 968ed4ab09 front: refresh ref_resource before reporting watermark transcoding
Made-with: Cursor
2026-04-27 10:53:05 +08:00
weli f5ad926bf9 front: prevent download freeze on watermark completed tasks
Made-with: Cursor
2026-04-27 10:48:42 +08:00
weli 75e712aa21 front: download watermark URL from vals before TS-only branch
Made-with: Cursor
2026-04-27 08:17:41 +08:00
weli 7955cde30e front: canonical watermarked_video_url for WATERMARK task_result
Made-with: Cursor
2026-04-27 08:13:27 +08:00
weli 7015337d94 migrate TS API calls from /api/v1/ts/ to /api/v2/ts/ 2026-04-26 22:19:27 +08:00
weli b5be88c073 fix: show actual createTask error reason in toast 2026-04-26 22:16:50 +08:00
weli 549738c4a1 fix(front): 练习/课程视频上传后创建 VIDEO_COMPRESSION 任务
上传又拍云并 create_hty_resource 成功后调用 TS create_task,
把任务写入 ref_resource.tasks,供 htyproc 处理与 ref-resource 轮询。

Made-with: Cursor
2026-04-26 22:00:24 +08:00
weli f5b18ae0e1 fix(cdn): upload_assets 默认调用 /usr/local/bin/upyun_tool
可通过环境变量 UPYUN_TOOL 覆盖路径。

Made-with: Cursor
2026-04-26 21:49:13 +08:00
weli 81fe1224df fix(scripts): cp_dist_moicen 用 hostname 与 POSIX 判断,固定 build:moicen
避免 SSH 非登录环境下 HOSTNAME 为空导致 npm run build: 失败;/bin/sh 下 [[ 不可用。

Made-with: Cursor
2026-04-26 21:39:15 +08:00
weli 19fbb53060 fix(front): 打卡/计划提交不再强制课程含图片;选课不限媒体;曲谱文案改为图片
- daka/jihua prepare 去掉仅 Picture+CourseSection 的前端校验
- pick 列表始终可选课,去掉仅按图片判断的警告
- 课程与练习相关界面 ref_name 与提示由「曲谱」改为「图片」等

Made-with: Cursor
2026-04-26 21:38:34 +08:00
weli be211a2638 fix(front): tabbar 首页直达角色工作台路径;路由与类型调整(music-room 欢迎页等)
Made-with: Cursor
2026-04-26 17:09:42 +08:00
weli 31f071ff80 fix(vite): moicen assets_base / for nginx music-room self-host (avoid static 404)
Made-with: Cursor
2026-04-26 16:11:12 +08:00
weli f5451f97f7 feat(dev): add /__dev/session to paste UC JWT + sudo for local browser QA
Production build omits route via import.meta.env.DEV guard.

Made-with: Cursor
2026-04-26 16:08:59 +08:00
weli 9dff5a04b6 fix(index): replace huiwings.cn iframe with in-app role home redirect
Logged-in users on music-room.moicen.com saw a blank center because iframe
targeted huiwings.cn (cross-origin / no session). Redirect to /student/home,
/teacher/home, /admin/teachers, /tester, or supervisor path on same origin.

Made-with: Cursor
2026-04-26 16:06:44 +08:00
weli b1996f3cd1 fix(wx): strip identity from share page_path; guard router unionid switch
- Sanitize page_path before router.push (H5) to prevent cross-user login via shared link
- onShareAppMessage: remove unionid/openid/status and related query keys from shared path
- main.ts: fix login(to.query.toString()) bug; when already logged in, strip foreign unionid from URL instead of logout

Made-with: Cursor
2026-04-26 15:58:56 +08:00
weli 3a6b9b6973 refactor(types): Tongzhi/TongzhiContent from domain; align with commons envelope DTO
Made-with: Cursor
2026-04-24 09:48:47 +08:00
weli 7d4170913b chore: export NotifyTypes from src/domain/notifyTypes
Made-with: Cursor
2026-04-24 09:17:36 +08:00