修改页面,完成单页模式新增首页返回上一页按钮

This commit is contained in:
2026-08-31 14:48:32 +08:00
parent aaed0584b1
commit 15b301b358
363 changed files with 10895 additions and 213 deletions
+4 -9
View File
@@ -48,12 +48,7 @@
function redirectUnauthorized(api, error) {
if (!shouldRedirectToLogin(api, error)) return false;
if (api && api.clearToken) api.clearToken();
if (!root.location) return true;
if (typeof root.location.replace === 'function') {
root.location.replace('login.html');
return true;
}
root.location.href = 'login.html';
root.NavigationUtil.open('login.html');
return true;
}
@@ -179,7 +174,7 @@
if (!feedId || !genealogyId) return;
if (!query('[data-feed-detail-page]')) {
if (root.location) root.location.href = buildFeedUrl('detail', genealogyId, feedId);
root.NavigationUtil.open(buildFeedUrl('detail', genealogyId, feedId));
return;
}
if (getCurrentFeedId() !== toId(feedId)) return;
@@ -883,7 +878,7 @@
await api.feedDetail(genealogyId, savedFeedId);
}
showMessage('动态已保存');
root.location.href = buildPostSaveUrl(genealogyId, savedFeedId, body.status);
root.NavigationUtil.open(buildPostSaveUrl(genealogyId, savedFeedId, body.status));
} catch (error) {
if (redirectUnauthorized(api, error)) return;
setFeedFormStatus(
@@ -930,7 +925,7 @@
return withActionLock('delete:' + feedId, async function () {
try {
await api.deleteFeed(genealogyId, feedId);
if (query('[data-feed-detail-page]')) root.location.href = buildFeedUrl('list', genealogyId);
if (query('[data-feed-detail-page]')) root.NavigationUtil.open(buildFeedUrl('list', genealogyId));
else await loadFeeds(currentFeedPage);
} catch (error) {
if (redirectUnauthorized(api, error)) return;