From 49ccba6556a3cb9e692005a7f6580996f25233e1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Wed, 12 Nov 2025 19:11:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(bi):=20=E7=A7=BB=E9=99=A4=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=B9=B6=E6=89=A9=E5=B1=95=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=8E=88=E6=9D=83=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除console.log调试语句 - 添加对127.0.0.1的本地开发授权支持 - 扩展不同页面类型的硬币显示逻辑 - 更新本地开发授权token --- component/bi/bi.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/component/bi/bi.js b/component/bi/bi.js index 8ceee13..7b3d714 100644 --- a/component/bi/bi.js +++ b/component/bi/bi.js @@ -106,8 +106,6 @@ class BiCard extends HTMLElement { token: this.token, num, }).then((res) => { - console.log("res", res); - if (res.code == 200) creationAlertBox("success", res.message); else creationAlertBox("error", res.message); @@ -120,7 +118,9 @@ class BiCard extends HTMLElement { this.coinsEl.textContent = coins || 0; if (this.pagetpye == "forum") document.querySelector(".action-bar-item.coins .text").textContent = coins || 0; - + if (this.pagetpye == "vote") document.querySelector(".coinText").textContent = coins || 0; + if (this.pagetpye == "mj") document.querySelector(".coinText").textContent = coins || 0; + if (this.pagetpye == "offer") document.querySelector(".broadside-text.cursorpointer.coinText").textContent = (coins || 0) + " 寄托币"; this.getCoinRankList(); }); } @@ -156,7 +156,7 @@ class BiCard extends HTMLElement { xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/json"); - if (location.hostname == "localhost") xhr.setRequestHeader("Authorization", "01346a38444d71aaadb3adad52b52c39"); + if (["127.0.0.1","localhost"].includes(location.hostname)) xhr.setRequestHeader("Authorization", "3b01343c65e3b2fa3ce32ae26feb3a9b"); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { @@ -175,8 +175,7 @@ class BiCard extends HTMLElement { xhr.withCredentials = true; xhr.open("GET", url, true); - - if (location.hostname == "localhost") xhr.setRequestHeader("Authorization", "01346a38444d71aaadb3adad52b52c39"); + if (["127.0.0.1","localhost"].includes(location.hostname)) xhr.setRequestHeader("Authorization", "3b01343c65e3b2fa3ce32ae26feb3a9b"); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) {