Skip to content

Releases: lulaide/rollcall-ios

1.0.31 (a667f79)

Choose a tag to compare

@github-actions github-actions released this 12 May 11:37
feat: 全学期课程/搜索/课表跳历史/主页今日签到状态 + zh 本地化

数据源
- 历史 tab 从 /api/user/recently-visited-courses(只展示最近访问过)
  改为 /api/my-courses + /api/my-semesters 过滤本学期全部课程
- LMSClient 加 history/courses/semesterID 缓存 + clearCaches()

UI
- 历史 tab 加 .searchable
- 课表 tab 每行 NavigationLink 到该课程的签到历史(若能匹配 LMS 课程)
- 主页改造为"今日课程"段:遍历今天课表,对每门课查当天签到记录,
  显示状态徽章(已签到/迟到/缺勤/进行中/未发起),点击行跳转
- 登录页换成原生 Form/Section,按钮去掉强制 50pt 高度
- Info.plist 加 CFBundleDevelopmentRegion=zh-Hans 让系统字符串本地化
  (ContentUnavailableView.search 等)

课程名匹配
- canonicalCourseName() 把课表名和 LMS 名都按 `-` 或半角 `(` 截取主名
  再比较,保留全角 `()`(是名字本身的一部分)
- 解决体育课匹配失败的问题:课表"大学体育2(下)-大学体育2(下)网球1班"
  和 LMS"大学体育2(下)(大学体育2(下)网球1班)"前者更长,旧逻辑只对
  LMS 名截短无效

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

1.0.30 (c9fb2c3)

Choose a tag to compare

@github-actions github-actions released this 12 May 10:40
fix: form 字段使用 RFC 3986 unreserved 编码,避免 base64 密码中 +/ 被服务器误解析

`.urlQueryAllowed` 字符集过于宽松,不会编码 + / = &。AES 加密后的 base64
密码经常包含 +/,发到 IDS 后 + 被解释为空格、/ 保留为路径分隔符,导致
密码校验失败返回 401(浏览器登录正常是因为浏览器按 RFC 3986 严格编码)。

改用 formURLEncode() 仅允许 alphanumerics + "-._~",并把 service 查询参数
切到 URLComponents/URLQueryItem 让系统正确编码。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

1.0.29 (0d626e4)

Choose a tag to compare

@github-actions github-actions released this 12 May 06:47
fix: 手动 follow redirect 解决 iOS HTTPS→HTTP 降级丢 cookie 问题

iOS URLSession 自动 follow redirect 时,跨域 HTTPS(ids) → HTTP(identity/lms)
的降级会被静默拦截,导致 CAS 验证链没走完,role_token cookie 不会被设置,
最终用着匿名的 session cookie 调 API 返回 302。

修复:
- 新增 followAllRedirectsManually,用主 session (带 NoRedirectDelegate) 手动
  跟踪 301-308 全部重定向,最多 20 跳
- 登录后必须检测到 role_token cookie(仅 CAS 验证成功后才会设置),否则报错
- 仍保留登录后 API 测试调用作为最终验证

经 simulator + 注入 Python 有效 cookie 验证整套 UI 流程正常:
- ✅ Dashboard / 课表 / 历史 / 设置 全部正常加载
- ✅ Center WebSocket 连接
- ✅ 设置页显示真实姓名(鲁同轩)和学号
- ✅ 历史 tab 显示完整签到记录 + 78% 出勤率

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 11 May 03:56

Full Changelog: v1.0.0...v1.1.0

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 11 May 03:46

1.0.28 (252bc65)

Choose a tag to compare

@github-actions github-actions released this 11 May 16:54
fix: 登录失败正确报错,避免被匿名 session cookie 误判为成功

之前的 bug:LMS 初始 GET 会发匿名 session cookie,login() 只检查
"session cookie 是否存在" 就认为登录成功。当 IDS POST 实际失败时
(401/needCaptcha 等),会带着无效 cookie 进主页,poller 调 API 立刻
302 触发 handleSessionExpired,用户看到 "会话已过期" 而非真实原因。

现在:
- POST 401/403 → 抛 "IDS 登录被拒绝 (HTTP xxx)"
- POST 200 含 needCaptcha → 抛 "需要验证码"
- POST 200 含 badCredentials → 抛 "账号或密码错误"
- POST 302 → 跟随重定向后用真实 API 验证 session 有效才算成功

1.0.27 (ac5d158)

Choose a tag to compare

@github-actions github-actions released this 11 May 15:57
fix: 移除所有自动重登逻辑,避免 IDS 频繁触发封控

- getRollcalls / getJSON 收到 302/401 时抛 sessionExpired,不再自动 login
- AppState 全局处理 sessionExpired:stopServices + 回登录页
- 只有用户在登录页主动点"登录"才会触发 IDS POST
- LMS cookie 有效期较长,重启 app/切 tab/轮询都复用持久化 cookie

1.0.26 (ce3cc01)

Choose a tag to compare

@github-actions github-actions released this 11 May 12:04
fix: 历史接口 session 过期自动重登 + Course.name 兼容 null

经 HAR 验证:所有 Codable 字段类型正确,"加载失败" 是因为 session 过期
返回 HTML 而非 JSON。新增 getJSON helper:检测 302/401 自动 login() 重试,
三个历史 API 都走它。Course.name 也改为可选作防御。

1.0.25 (d795696)

Choose a tag to compare

@github-actions github-actions released this 11 May 11:42
feat: 设置页显示 LMS 姓名+学号,隐藏 IDS 账号

- 启动后台从 LMS 获取并缓存姓名
- 设置页:姓名(如有) + 学号 + Client ID
- 移除 IDS 账号显示(私密信息)

1.0.24 (ca75b8a)

Choose a tag to compare

@github-actions github-actions released this 11 May 11:37
feat: 添加签到历史功能

- 新增"历史"Tab 显示所有课程的签到记录
- 通过 /api/user/recently-visited-courses 获取课程列表
- 通过 /api/course/{id}/students 反查内部 user_id 并缓存
- 通过 /api/course/{id}/student/{user_id}/rollcalls 获取签到历史
- 每门课显示出勤率 + 已签/缺勤/迟到统计 + 签到时间线