fix: AppKey揭示改为显示完整明文并留审计;追溯码链接改为直连系统设置的客户端地址
This commit is contained in:
@@ -139,7 +139,7 @@ export const settingsApi = {
|
||||
tianheVerify: (data: { userId: string; userKey: string }) =>
|
||||
post<{ userId: string; address: string }>('/settings/tianhe/verify', data),
|
||||
tianheIdentity: () => get<{ userId: string; address: string; userKeyMasked: string }>('/settings/tianhe/identity'),
|
||||
tianheRevealAppKey: () => post<{ appKeyMasked: string }>('/settings/tianhe/app-key/reveal', {}),
|
||||
tianheRevealAppKey: () => post<{ appKey: string }>('/settings/tianhe/app-key/reveal', {}),
|
||||
tianheReveal: () => post<{ userId: string; userKey: string; address: string }>('/settings/tianhe/identity/reveal', {}),
|
||||
tianheRotate: () => post<{ userId: string; userKey: string; address: string }>('/settings/tianhe/identity/rotate', {}),
|
||||
};
|
||||
|
||||
@@ -589,7 +589,7 @@
|
||||
"tianheCopyConfirmTitle": "Copy User Key",
|
||||
"tianheCopyConfirmContent": "Copying writes the full User Key to the clipboard and will be recorded in the operation log. Make sure your environment is secure before continuing.",
|
||||
"tianheAppKeyRevealTitle": "View App Key",
|
||||
"tianheAppKeyRevealContent": "This action will be recorded in the operation log. Make sure your environment is secure before continuing. Only the masked form is shown; the full App Key is never displayed.",
|
||||
"tianheAppKeyRevealContent": "This will display the full App Key and be recorded in the operation log. Make sure your environment is secure before continuing.",
|
||||
"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}",
|
||||
|
||||
@@ -589,7 +589,7 @@
|
||||
"tianheCopyConfirmTitle": "复制 User Key",
|
||||
"tianheCopyConfirmContent": "复制会将完整 User Key 写入剪贴板,该操作将记入操作日志。请确认当前环境安全后再继续。",
|
||||
"tianheAppKeyRevealTitle": "查看 App Key",
|
||||
"tianheAppKeyRevealContent": "该操作将记入操作日志,请确认当前环境安全后再继续。查看仅显示掩码形式,不会显示完整 App Key。",
|
||||
"tianheAppKeyRevealContent": "该操作将显示完整 App Key 并记入操作日志,请确认当前环境安全后再继续。",
|
||||
"tianheIdentityHint": "User Key 是打开平台托管钱包的唯一凭据,天河链不留存、无法找回。请务必离线保存 User ID 与 User Key;重装或迁移系统后可通过「手动录入」继续使用同一链上身份。",
|
||||
"tianheRegisterDone": "链上身份注册成功",
|
||||
"tianheSaveKeyWarning": "请立即离线保存以下凭据(丢失将无法继续以同一身份存证):User ID:{userId};User Key:{userKey}",
|
||||
|
||||
@@ -396,9 +396,14 @@ async function loadIdentity() {
|
||||
}
|
||||
}
|
||||
|
||||
// 查看 AppKey:二次确认后经审计 POST 接口获取掩码(服务端只回掩码,永不回明文)
|
||||
// 揭示 AppKey 明文:二次确认后经审计 POST 接口获取(写操作日志)。
|
||||
// 收起时若用户未编辑过,恢复为服务端掩码,避免明文长期留在输入框。
|
||||
let revealedPlainAppKey = '';
|
||||
function toggleAppKeyReveal() {
|
||||
if (appKeyRevealed.value) {
|
||||
if (form.tianheAppKey === revealedPlainAppKey) {
|
||||
form.tianheAppKey = loadedTianheAppKey;
|
||||
}
|
||||
appKeyRevealed.value = false;
|
||||
return;
|
||||
}
|
||||
@@ -408,11 +413,13 @@ function toggleAppKeyReveal() {
|
||||
positiveText: t('common.action.confirm'),
|
||||
negativeText: t('common.action.cancel'),
|
||||
onPositiveClick: async () => {
|
||||
const res = await settingsApi.tianheRevealAppKey();
|
||||
// 仅在输入框仍是服务端掩码(未被编辑)时刷新掩码,避免覆盖用户新填的值
|
||||
if (form.tianheAppKey === loadedTianheAppKey && res.appKeyMasked) {
|
||||
form.tianheAppKey = res.appKeyMasked;
|
||||
loadedTianheAppKey = res.appKeyMasked;
|
||||
// 仅在输入框仍是服务端掩码(未被编辑)时回填明文,避免覆盖用户新填的值
|
||||
if (form.tianheAppKey === loadedTianheAppKey) {
|
||||
const res = await settingsApi.tianheRevealAppKey();
|
||||
if (res.appKey) {
|
||||
revealedPlainAppKey = res.appKey;
|
||||
form.tianheAppKey = res.appKey;
|
||||
}
|
||||
}
|
||||
appKeyRevealed.value = true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user