Commit b0615cd0 by jianan

fix: 手机号 claim 兼容 Casdoor 的 phone(原取标准 phone_number,Casdoor 下恒为空)

parent 7b68f4ea
......@@ -17,7 +17,8 @@ function toAuthUser(u: User | null): AuthUser | null {
if (!u || u.expired) return null
const p = u.profile
const name = p.name ?? p.preferred_username ?? ''
return { name, phone: p.phone_number ?? '' }
// Casdoor 的手机号 claim 是 `phone`(非标准 `phone_number`),两者兼容取
return { name, phone: (p.phone as string | undefined) ?? p.phone_number ?? '' }
}
export const useAuthStore = defineStore('auth', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment