fix: 注册 symbol_live_price.js 静态路由(现价不显示)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -107,17 +107,23 @@
|
||||
.then(function (r) {
|
||||
return r.json().then(function (d) {
|
||||
return { status: r.status, data: d };
|
||||
}).catch(function () {
|
||||
return { status: r.status, data: null };
|
||||
});
|
||||
})
|
||||
.then(function (res) {
|
||||
if (seq !== fetchSeq) return;
|
||||
el.classList.remove("symbol-live-price--loading");
|
||||
const data = res.data || {};
|
||||
if (res.status >= 400 || !data.ok) {
|
||||
if (res.status >= 400 || !data || !data.ok) {
|
||||
paint(el, sym, null, (data && data.msg) || "读取失败");
|
||||
return;
|
||||
}
|
||||
const px = data.last_price != null ? data.last_price : data.price;
|
||||
if (px === null || typeof px === "undefined") {
|
||||
paint(el, data.symbol || sym, null, "无法读取交易所价格");
|
||||
return;
|
||||
}
|
||||
paint(el, data.symbol || sym, px, "");
|
||||
if (!pollTimer) startPoll();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user