fix: 天河链对接修复 T1-T3/T6-T8(托管钱包注册与身份生命周期)

- TianheProvider 新增 registerUser/userInfo/ensureRegistered(接口1/8),attest 前幂等确保钱包已注册
- userDto 分段改为 application/json 类型 Blob,避免 Media Type Error
- 严格校验 code===0 且必须返回 transactionHash,杜绝以本地 dataHash 冒充链上哈希的假上链
- upload 响应不再提取恒空的区块信息,注释固化"每物一条 proof、独立 txHash"不变量
- userKey 改为一次性随机生成并明文持久化(不再从 appKey 派生),明文存储保证备份跨重装可恢复
- 新增 /settings/tianhe/register|verify|identity 接口与设置页链上身份区(注册/显示地址/揭示复制/手动录入校验)
- 单测扩至 27 个:新增注册、严格校验、userDto 类型、ensureRegistered 回退用例
This commit is contained in:
Nixevol
2026-07-09 19:05:32 +08:00
parent 8a7032070a
commit fa4215bd52
9 changed files with 512 additions and 104 deletions
+19 -1
View File
@@ -545,7 +545,25 @@
"tianheEnvCustom": "Custom",
"tianheBaseUrl": "API URL",
"tianheAppId": "App ID",
"tianheAppKey": "App Key"
"tianheAppKey": "App Key",
"tianheIdentity": "On-chain Identity (Platform Custodial Wallet)",
"tianheWalletAddress": "Wallet Address",
"tianheNotRegistered": "Not registered",
"tianheRegister": "Register Identity",
"tianheReRegister": "Re-verify Identity",
"tianheManualEntry": "Manual Entry",
"tianheReveal": "Reveal",
"tianheHide": "Hide",
"tianheCopy": "Copy",
"tianheCopied": "User Key copied",
"tianheIdentityHint": "The User Key is the only credential to open the platform custodial wallet. TiChain does not store it and it cannot be recovered. Keep the User ID and User Key offline; after reinstalling or migrating, use Manual Entry to continue with the same on-chain identity.",
"tianheRegisterDone": "On-chain identity registered",
"tianheSaveKeyWarning": "Save these credentials offline immediately (losing them means you cannot attest with the same identity again): User ID: {userId}; User Key: {userKey}",
"tianheVerifySave": "Verify & Save",
"tianheVerifyOk": "Verified. On-chain identity saved",
"tianheManualHint": "Enter the saved User ID and User Key. The system verifies them with TiChain before saving (for reusing the existing wallet after reinstall/migration).",
"tianheManualUserIdPh": "e.g. artveris-platform",
"tianheManualUserKeyPh": "The User Key you saved offline"
},
"profile": {
"title": "Personal Info",
+19 -1
View File
@@ -545,7 +545,25 @@
"tianheEnvCustom": "自定义",
"tianheBaseUrl": "接口地址",
"tianheAppId": "App ID",
"tianheAppKey": "App Key"
"tianheAppKey": "App Key",
"tianheIdentity": "链上身份(平台托管钱包)",
"tianheWalletAddress": "钱包地址",
"tianheNotRegistered": "未注册",
"tianheRegister": "注册链上身份",
"tianheReRegister": "重新确认身份",
"tianheManualEntry": "手动录入",
"tianheReveal": "揭示",
"tianheHide": "隐藏",
"tianheCopy": "复制",
"tianheCopied": "User Key 已复制",
"tianheIdentityHint": "User Key 是打开平台托管钱包的唯一凭据,天河链不留存、无法找回。请务必离线保存 User ID 与 User Key;重装或迁移系统后可通过「手动录入」继续使用同一链上身份。",
"tianheRegisterDone": "链上身份注册成功",
"tianheSaveKeyWarning": "请立即离线保存以下凭据(丢失将无法继续以同一身份存证):User ID:{userId};User Key:{userKey}",
"tianheVerifySave": "校验并保存",
"tianheVerifyOk": "校验通过,链上身份已保存",
"tianheManualHint": "输入已保存的 User ID 与 User Key,系统将向天河链校验后保存(用于重装/迁移后复用既有钱包)。",
"tianheManualUserIdPh": "如 artveris-platform",
"tianheManualUserKeyPh": "已离线保存的 User Key"
},
"profile": {
"title": "个人信息",