diff --git a/website/src/services/auth.js b/website/src/services/auth.js index 75194d4..3036fbb 100644 --- a/website/src/services/auth.js +++ b/website/src/services/auth.js @@ -23,6 +23,8 @@ function pickUser(d) { avatar: d.avatar || '', phone: d.phone || '', phoneBound: !!d.phoneBound, + wxBound: !!d.wxBound, + wxMiniBound: !!d.wxMiniBound, role: d.role || '', account_type: d.account_type || '', account_type_label: d.account_type_label || '', diff --git a/website/src/user/Profile.jsx b/website/src/user/Profile.jsx index c08891c..a5d203f 100644 --- a/website/src/user/Profile.jsx +++ b/website/src/user/Profile.jsx @@ -71,6 +71,8 @@ export default function Profile() { try { const p = await me(); setBind({ phone: p.phone || '', phoneBound: !!p.phoneBound, wxBound: !!p.wxBound, wxMiniBound: !!p.wxMiniBound }); + // 用 fresh /me 回写本地用户缓存与用户卡,避免读 stale localStorage 导致手机号/绑定不同步 + saveUser({ ...getUser(), phone: p.phone || '', phoneBound: !!p.phoneBound, wxBound: !!p.wxBound, wxMiniBound: !!p.wxMiniBound }); setUser(getUser() || {}); } catch (e) { /* 未登录 */ } };