diff --git a/src/views/auth-onboarding-view.jsx b/src/views/auth-onboarding-view.jsx index 64d71714..ec758925 100644 --- a/src/views/auth-onboarding-view.jsx +++ b/src/views/auth-onboarding-view.jsx @@ -678,6 +678,16 @@ function Realname({authenticated = false}) { const data = await submitRealname({name: name.trim(), id_type: 'cn_id', id_number: idNumber.toUpperCase()}); setStatus(data.status || 'pending'); setError(''); + // The submissions POST only ever returns {status, submission_id} -- never masked_name/ + // masked_id_number -- but GET /security/realname has carried both fields since this feature's + // original commit (confirmed against server source), we just weren't calling it again right + // after a successful submit. Best-effort: the submission itself already succeeded above, so a + // failure here shouldn't take that away from the user -- it just means the pre-existing + // fallback below (this session's own typed draft) keeps covering the display like before. + getRealnameStatus().then(fresh => { + if (fresh.masked_name) setMaskedName(fresh.masked_name); + if (fresh.masked_id_number) setMaskedIdNumber(fresh.masked_id_number); + }).catch(() => {}); } catch (err) { setError(err.message || '提交失败,请稍后重试'); } finally { @@ -701,12 +711,14 @@ function Realname({authenticated = false}) { 一旦账号真的走到 verified 状态就会显示一句参考图里根本不存在的标题。 */}

请您使用有效身份证信息认证

- {/* submitRealname's success response never actually carries masked_name/masked_id_number - (only {status, submission_id}) -- falling back to what was just typed (still sitting in - `name`/`idNumber` local state) means a fresh submission at least shows the user what - they submitted, instead of switching straight from their typed input to two blank - fields the instant `editable` flips false. Only degrades to genuinely blank on a fresh - page load with no draft in this session, which is the pre-existing, unavoidable case. */} + {/* submitRealname's own success response never carries masked_name/masked_id_number (only + {status, submission_id}) -- submit() above now follows up with a GET /security/realname + to fetch the server's authoritative masked values right after a successful submission, so + this local-draft fallback (`name`/`idNumber`, still sitting in state from what was just + typed) only matters for the brief window before that GET resolves. It still degrades to + genuinely blank on a fresh page load with no draft in this session and no masked value + from a prior GET either (e.g. a submission made in an earlier session) -- that residual + case isn't fixable from here since it depends on the follow-up GET actually having run. */} {error ?
{error}
: null}