feat(site): 导航登录态下拉菜单 + 个人信息/退出登录页,登录不再直跳 App
- 导航「进入系统 · 名字」改为下拉:个人信息 / 进入系统 / 退出登录,导航可重入刷新(window.jiuNavRender) - 新增 /profile/(账号 / 门店 / 授权三卡,authFetch 实时拉取)与 /logout/(撤销会话 + 清本地凭证) - 登录成功默认落地 /profile/(?next= 站内白名单不变),不再直跳 /app/ - auth.js 增加 jiuAuth.clear();site.css 含本轮下拉 / profile / 特惠卡样式 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
+3
-3
@@ -6,7 +6,7 @@ permalink: /login/
|
||||
---
|
||||
{# 官网内登录(不跳 App):POST /api/v1/auth/login,成功后把凭证写入与
|
||||
Web 版 App(shared_preferences_web)共享的 localStorage['flutter.*']
|
||||
(值为 JSON 编码,与插件格式一致),再进入 /app/ 即已登录。 #}
|
||||
(值为 JSON 编码,与插件格式一致),默认落地 /profile/;后续打开 /app/ 即已登录。 #}
|
||||
<div class="auth-wrap">
|
||||
<div class="auth">
|
||||
<div class="auth-brand">
|
||||
@@ -67,9 +67,9 @@ permalink: /login/
|
||||
.then(function (res) {
|
||||
if (!res.ok) throw new Error((res.j && res.j.error) || '登录失败,请检查账号信息');
|
||||
persist(res.j.data || {}, shop);
|
||||
// ?next= 仅允许站内路径(防开放跳转)
|
||||
// ?next= 仅允许站内路径(防开放跳转);默认留在官网(个人信息页),不跳 App
|
||||
var next = new URLSearchParams(location.search).get('next') || '';
|
||||
location.href = (next.charAt(0) === '/' && next.indexOf('//') !== 0) ? next : '/app/';
|
||||
location.href = (next.charAt(0) === '/' && next.indexOf('//') !== 0) ? next : '/profile/';
|
||||
})
|
||||
.catch(function (e) {
|
||||
showErr(e && e.message ? e.message : '无法连接服务器,请稍后重试');
|
||||
|
||||
Reference in New Issue
Block a user