验证20%
This commit is contained in:
@@ -209,6 +209,9 @@
|
||||
if (!created) throw new Error('创建响应缺少有效家谱信息');
|
||||
verified = normalizeCreatedGenealogy(await api.genealogyDetail(created.genealogyId));
|
||||
if (!verified || verified.genealogyId !== created.genealogyId) throw new Error('创建后无法读取同一家谱');
|
||||
if (root.ProfileUI && root.ProfileUI.setCurrentGenealogyContext) {
|
||||
root.ProfileUI.setCurrentGenealogyContext(verified.genealogyId, verified.genealogyName);
|
||||
}
|
||||
if (root.location) root.location.href = buildCreatedGenealogyUrl(verified);
|
||||
} catch (error) {
|
||||
if (shouldRedirectToLogin(api, error)) {
|
||||
@@ -266,6 +269,7 @@
|
||||
].filter(Boolean).join(' · ');
|
||||
|
||||
return '<a class="module-row" data-genealogy-id="' + escapeHtml(item.genealogyId) +
|
||||
'" data-genealogy-name="' + escapeHtml(item.genealogyName) +
|
||||
'" href="' + escapeHtml(buildEntryUrl(item.genealogyId, target)) + '">' +
|
||||
'<div><h3>' + escapeHtml(item.genealogyName) + '</h3><p>' + escapeHtml(meta) +
|
||||
'</p></div><span class="pill">' + (item.canManage ? '管理并进入' : '进入家谱') + '</span></a>';
|
||||
@@ -284,6 +288,10 @@
|
||||
var result;
|
||||
|
||||
if (!status) return;
|
||||
if (shouldRedirectToLogin(api)) {
|
||||
redirectToLogin(api);
|
||||
return;
|
||||
}
|
||||
if (!api || !api.genealogyQuota || !api.genealogiesMine) {
|
||||
status.textContent = '家谱入口接口初始化失败,请刷新后重试。';
|
||||
return;
|
||||
@@ -294,6 +302,10 @@
|
||||
renderGenealogies(container, result[0], target);
|
||||
status.textContent = buildStatus(result[1]);
|
||||
} catch (error) {
|
||||
if (shouldRedirectToLogin(api, error)) {
|
||||
redirectToLogin(api);
|
||||
return;
|
||||
}
|
||||
status.textContent = '无法读取我的家谱,请稍后重试。';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user