feat: openid-login + avatar_url 修复
- 后端: 新增 /auth/openid-login 接口(调 CRMEB 补齐用户信息) - 后端: config.py 新增 crmeb_base_url / crmeb_api_key 配置 - 后端: api.ts 新增 openid-login 接口声明 - 前端: LoginPage 改为走 openid-login(openid 单参登录) - 前端: UserContext 修复 avatar_url 未映射导致头像不显示的问题
This commit is contained in:
@@ -12,6 +12,7 @@ export interface UserProfile {
|
||||
name: string;
|
||||
age: number | null;
|
||||
phone: string;
|
||||
avatar_url: string | null;
|
||||
lastPeriodDate: string; // YYYY-MM-DD
|
||||
dueDate: string;
|
||||
currentWeek: number;
|
||||
@@ -35,6 +36,7 @@ const DEFAULT_PROFILE: UserProfile = {
|
||||
name: "",
|
||||
age: null,
|
||||
phone: "",
|
||||
avatar_url: null,
|
||||
lastPeriodDate: "",
|
||||
dueDate: "",
|
||||
currentWeek: 0,
|
||||
@@ -154,6 +156,7 @@ function mapDtoToProfile(dto: UserProfileDTO): UserProfile {
|
||||
name: dto.name || "",
|
||||
age: dto.age,
|
||||
phone: dto.phone || "",
|
||||
avatar_url: dto.avatar_url || null,
|
||||
lastPeriodDate: lmpDate,
|
||||
dueDate,
|
||||
currentWeek,
|
||||
|
||||
Reference in New Issue
Block a user