fix(bi): 移除调试日志并扩展本地开发授权支持
- 删除console.log调试语句 - 添加对127.0.0.1的本地开发授权支持 - 扩展不同页面类型的硬币显示逻辑 - 更新本地开发授权token
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user