发货方式优化及消息功能优化
This commit is contained in:
@@ -62,7 +62,15 @@ Component({
|
||||
if (!force && now - (this._lastFetchAt || 0) < 5000) {
|
||||
return;
|
||||
}
|
||||
//上一次请求尚未结束时不再发起,避免请求堆积占满并发导致页面假死
|
||||
if (this._fetching) {
|
||||
return;
|
||||
}
|
||||
this._lastFetchAt = now;
|
||||
this._fetching = true;
|
||||
const done = () => {
|
||||
this._fetching = false;
|
||||
};
|
||||
fetchMessageUnreadCount().then((res) => {
|
||||
if (res.code == 1) {
|
||||
const unread = Number(res.data?.unread_count) || 0;
|
||||
@@ -70,7 +78,7 @@ Component({
|
||||
const app = getApp();
|
||||
if (app) app.globalData.unread = unread;
|
||||
}
|
||||
}).catch(() => {});
|
||||
}).catch(() => {}).then(done, done);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user