修改页面,完成单页模式新增首页返回上一页按钮
This commit is contained in:
@@ -91,13 +91,7 @@
|
||||
|
||||
function redirectToLogin(api) {
|
||||
if (api && api.clearToken) api.clearToken();
|
||||
if (!root.location) return;
|
||||
if (typeof root.location.replace === 'function') {
|
||||
root.location.replace('login.html');
|
||||
return;
|
||||
}
|
||||
|
||||
root.location.href = 'login.html';
|
||||
root.NavigationUtil.open('login.html');
|
||||
}
|
||||
|
||||
function redirectUnauthorized(api, error) {
|
||||
@@ -417,7 +411,7 @@
|
||||
setStatus(form, 'loading', '正在提交注销申请…');
|
||||
await api.deactivateAccount(buildDeactivateBody(values));
|
||||
showMessage('账号已提交注销');
|
||||
root.location.href = 'index.html';
|
||||
root.NavigationUtil.open('index.html');
|
||||
} catch (error) {
|
||||
if (redirectUnauthorized(api, error)) return;
|
||||
setStatus(form, 'error', '注销失败,请稍后重试。');
|
||||
@@ -437,7 +431,7 @@
|
||||
} catch (error) {
|
||||
// 退出请求失败时客户端仍会清理本地令牌,页面必须离开受保护区域。
|
||||
} finally {
|
||||
root.location.href = 'index.html';
|
||||
root.NavigationUtil.open('index.html');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user