feat: 用户资料改回自同步 Casimir(昵称/邮箱)+ 头像改走 Casimir upload-resource
- 站内改昵称/邮箱/头像后,用自己的 access_token 写回 Casimir(update-user,字段每批≤2,401 自动 refresh_token 续期) - 头像不再本地存储:上传直调 Casimir upload-resource (tag=avatar),成功后自动写回 user.Avatar,仅落库返回 URL - me.patch 头像仅存档本地,避免 update-user 重复同步 - 头像上传仅走 Casimir,未配置 Storage provider 时报错提示 - exchangeCodeForIdentity 补 owner/displayName/token,昵称优先 displayName - 新增类型检查依赖 typescript/vue-tsc 与 typecheck 脚本
This commit is contained in:
+2
-2
@@ -55,8 +55,8 @@ export const useUserStore = defineStore('user', () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 仅支持修改用户名(头像/邮箱等账号信息统一由 Casdoor 管理)
|
||||
const updateProfile = async (patch: { username?: string }): Promise<ApiResult> => {
|
||||
// 修改个人资料:昵称(->Casimir displayName)/邮箱/头像,由后端与 Casimir 同步
|
||||
const updateProfile = async (patch: { username?: string; email?: string; avatar?: string }): Promise<ApiResult> => {
|
||||
try {
|
||||
const data = await $fetch<{ user: User }>('/api/auth/me', { method: 'PATCH', body: patch })
|
||||
user.value = data.user
|
||||
|
||||
Reference in New Issue
Block a user