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