修改页面,完成单页模式新增首页返回上一页按钮
This commit is contained in:
@@ -368,9 +368,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');
|
||||
else root.location.href = 'login.html';
|
||||
root.NavigationUtil.open('login.html');
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -662,7 +660,7 @@
|
||||
if (!savedId) throw new Error('保存响应缺少 albumId');
|
||||
verified = findAlbumById(await api.albums(genealogyId), savedId);
|
||||
if (!verified) throw new Error('保存后相册列表未返回同一相册');
|
||||
if (root.location) root.location.href = buildDetailUrl(genealogyId, savedId);
|
||||
root.NavigationUtil.open(buildDetailUrl(genealogyId, savedId));
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setStatus(
|
||||
@@ -725,7 +723,7 @@
|
||||
try {
|
||||
await api.deleteAlbum(genealogyId, albumId);
|
||||
if (query('[data-album-page]')) await loadAlbums();
|
||||
else if (root.location) root.location.href = buildListUrl(genealogyId);
|
||||
else root.NavigationUtil.open(buildListUrl(genealogyId));
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
showMessage(isForbidden(error) ? '当前账号无权删除该相册。' : (error.message || '相册删除失败'));
|
||||
|
||||
Reference in New Issue
Block a user