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) {