fix: harden bd leader history more params
This commit is contained in:
parent
ff759a9898
commit
d19b96059f
@ -7,8 +7,13 @@
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
var search = window.location.search
|
||||
window.location = "https://h5.haiyihy.com/hyapp/bd-leader-center/index.html" + search
|
||||
var target = new URL("https://h5.haiyihy.com/hyapp/bd-leader-center/index.html")
|
||||
var source = new URL(window.location.href)
|
||||
source.searchParams.forEach(function (value, key) {
|
||||
target.searchParams.set(key, value)
|
||||
})
|
||||
target.searchParams.set("h5v", "20260429-0335")
|
||||
window.location.replace(target.toString())
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@ -168,6 +168,6 @@
|
||||
|
||||
<div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
|
||||
</div>
|
||||
<script src="./script.js?v=20260429-0315" defer></script>
|
||||
<script src="./script.js?v=20260429-0335" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -679,7 +679,7 @@
|
||||
more.className = "more-button";
|
||||
more.type = "button";
|
||||
more.textContent = message("more");
|
||||
more.addEventListener("click", () => showHistoryMore(item?.billBelong));
|
||||
more.addEventListener("click", () => showHistoryMore(item));
|
||||
row.appendChild(more);
|
||||
}
|
||||
return row;
|
||||
@ -739,6 +739,7 @@
|
||||
|
||||
function normalizeDateText(value) {
|
||||
return digitMaps.reduce((textValue, [from, to]) => textValue.split(from).join(to), String(value || ""))
|
||||
.replace(/&/gi, "&")
|
||||
.replace(/&(?:rlm|lrm);/gi, "")
|
||||
.replace(/ /gi, " ")
|
||||
.replace(/[\u061c\u200e\u200f]/g, "")
|
||||
@ -762,6 +763,7 @@
|
||||
function normalizeBillBelong(value) {
|
||||
const textValue = normalizeDateText(value);
|
||||
if (!textValue) return "";
|
||||
if (/^\d{6,8}$/.test(textValue)) return textValue;
|
||||
|
||||
const isoMatch = textValue.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?/);
|
||||
if (isoMatch) {
|
||||
@ -804,8 +806,8 @@
|
||||
return "";
|
||||
}
|
||||
|
||||
function historyMorePath(billBelong) {
|
||||
const normalized = normalizeBillBelong(billBelong);
|
||||
function historyMorePath(source) {
|
||||
const normalized = normalizeBillBelong(source?.billBelong ?? source?.period ?? source?.billTitle ?? source);
|
||||
return normalized ? `/team/bd/leader/history/more?billBelong=${encodeURIComponent(normalized)}` : "";
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user