Files
MemRelay/projects/f5708b07-f0ea-42a4-b4ed-0e5443990ff9/Checkpoint 2026-11-16 10-13-19 UTC [6894f64761].md
T
memrelay ca932a29b4 create: Checkpoint 2026-11-16 10:13:19 UTC [6894f64761]
MemRelay-Operation: checkpoint-save:2026-11-16-login-cookie-and-restart
MemRelay-Resource: 0802293a-b77c-4ea1-8c78-4b22dec12d67
2026-11-16 18:13:23 +08:00

33 lines
2.5 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.
---
title: Checkpoint 2026-11-16 10:13:19 UTC [6894f64761]
type: checkpoint
permalink: main/projects/f5708b07-f0ea-42a4-b4ed-0e5443990ff9/checkpoint-2026-11-16-10-13-19-utc-6894f64761
stable_id: 0802293a-b77c-4ea1-8c78-4b22dec12d67
scope: project
memory_type: checkpoint
project_id: f5708b07-f0ea-42a4-b4ed-0e5443990ff9
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: 2026-11-16-login-cookie-and-restart
created_at: '2026-11-16T10:13:19.959828+00:00'
updated_at: '2026-11-16T10:13:19.959828+00:00'
tags:
- handoff
- login
- study-settings
---
做了什么:修复密码登录返回 500、页面显示「登录失败」,以及保存定时配置返回 Method Not Allowed。提交 0954c7e,已推送 origin/main。
原因:httpx==0.28.1 的 Cookies.set 只接受 name/value/domain/path,authorize、restore、session_token 传 secure=True 会 TypeError,未捕获异常变成纯文本 500,前端把空响应显示成「登录失败」。另外,8000 上的进程从 2026-11-16 01:10 一直没重载,只有 GET /api/settings/study,当前前端 PUT 该路径就是 405。
关键实现:client.set_cookie 直接写 cookiejar,secure 仍为 True。自动学习刷新 ELEARNING_00024 也走这个函数。登录接口 5xx 时前端显示「登录没有完成,请稍后再试。」。
验证:test_uac.py 5 passed。重启后的进程上,工号 6650000146 密码登录 200 并写下会话 Cookie;已登录的 PUT /api/settings/study 返回 200,目标 600、每月 8 日 00:00:00、开启、5 门课。浏览器里从登录页进入首页并点了保存定时配置,日志为 PUT 200,页面没有 Method Not Allowed。
本机运行:旧进程已停。当前 uvicorn 监听 127.0.0.1:8000,密钥在项目根目录 .env(已 gitignore)。EUNIV_SECRET_KEY 是新的 43 字符密钥,EUNIV_SECRET_KEY_OLD 仍是原来的短密钥,已有密文还能解开。不要再用只有短密钥的旧命令启动,当前代码会拒绝少于 32 字符的密钥。启动时数据库从 0007 升到 0008。
管理员:启动时发现管理员口令仍是初始默认值,已按现有逻辑换成随机口令并哈希。密文只在密码库条目「EunivTools 本地管理员」,用户名 admin。不要把口令写进仓库、日志或记忆。
给下个会话:不要加「北京时间」文案;拼图没对准仍显示新图加「没对准,请再试一次」。不要编辑 0001_init,不要提交 data/Temp/dist/.env/aidocs。不要为 6650000146 启动真实学习。本机服务已在跑,重启时先读 .env。