All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 7s
55 lines
2.3 KiB
HTML
55 lines
2.3 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>新建商品 · Airshelf</title>
|
|
<meta http-equiv="Cache-Control" content="no-store, must-revalidate">
|
|
<meta http-equiv="Pragma" content="no-cache">
|
|
<meta http-equiv="Expires" content="0">
|
|
<!-- 双保险:JS 没跑也能跳走 (1.5s 后强制回 products.html) -->
|
|
<meta http-equiv="refresh" content="1.5; url=products.html?npd=1">
|
|
<style>
|
|
html,body{background:#f9f9f9;margin:0;height:100%;font-family:'Inter',system-ui,sans-serif;}
|
|
.stub-msg{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;color:#999;font-size:13px;}
|
|
.stub-msg .ttl{font-size:14px;color:#262626;font-weight:500;}
|
|
.stub-msg a{color:#fa5d19;text-decoration:underline;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="stub-msg">
|
|
<div class="ttl">正在打开「新建商品」…</div>
|
|
<div>如未自动跳转,<a href="products.html?npd=1">点击这里</a></div>
|
|
</div>
|
|
<script>
|
|
/* ============================================================
|
|
新建商品 · 重定向 stub
|
|
----------------------------------------------------------
|
|
旧版本是一个 3883 行的全屏 drawer 页(legacy 备份在 product-create.legacy.html)。
|
|
现在「新建商品」改为 drawer 形态在原页面弹出,直接访问此 URL 没有意义。
|
|
|
|
行为:
|
|
1. 设置 sessionStorage 标志,通知落地页自动打开 drawer
|
|
2. 优先回退到 referrer(用户来源页),否则去 products.html
|
|
3. cache-bust 参数 ?npd=1 强制浏览器重新拉新版宿主页
|
|
============================================================ */
|
|
(function () {
|
|
try { sessionStorage.setItem('npd-auto-open', '1'); } catch (e) {}
|
|
try { sessionStorage.setItem('auto-open-new-product', '1'); } catch (e) {}
|
|
|
|
const ref = document.referrer || '';
|
|
const here = location.origin + location.pathname;
|
|
|
|
// 同源 referrer 且不是自身才回跳, 否则去 products.html
|
|
let target = 'products.html';
|
|
if (ref && ref.indexOf(location.origin) === 0 && ref.split('#')[0].split('?')[0] !== here) {
|
|
target = ref;
|
|
}
|
|
// 加 cache-bust query · 强制浏览器拉新版宿主页,避免再次命中缓存旧版
|
|
const sep = target.indexOf('?') >= 0 ? '&' : '?';
|
|
target = target + sep + 'npd=' + Date.now().toString(36);
|
|
location.replace(target);
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|