generated from tailored/router-template
fix: fix
This commit is contained in:
parent
29725a8614
commit
71359fba88
@ -26,6 +26,7 @@ app
|
||||
} else {
|
||||
ctx.body = {
|
||||
unread_count: 0,
|
||||
likes: 0,
|
||||
};
|
||||
}
|
||||
})
|
||||
|
@ -14,13 +14,16 @@ app
|
||||
key: 'getUnread',
|
||||
});
|
||||
console.log('unredRes', unredRes.body, unredRes.code);
|
||||
|
||||
if (unredRes.code === 200) {
|
||||
const unread_count = unredRes.body.unread_count;
|
||||
const likes = unredRes.body.likes;
|
||||
const unread = unread_count - likes;
|
||||
const mentionRes = await app.call({
|
||||
path: 'mention',
|
||||
key: 'getMention',
|
||||
payload: {
|
||||
num: unread_count,
|
||||
num: unread,
|
||||
},
|
||||
});
|
||||
if (mentionRes.code === 200) {
|
||||
|
@ -21,18 +21,20 @@ taskApp
|
||||
if (res.code === 200) {
|
||||
const data = res.body;
|
||||
const unread_count = data.unread_count;
|
||||
if (unread_count > 0) {
|
||||
const likes = data.likes;
|
||||
const unread = unread_count - likes;
|
||||
if (unread > 0) {
|
||||
queue.add(
|
||||
'mention',
|
||||
{
|
||||
path: 'task',
|
||||
key: 'getMention',
|
||||
payload: {
|
||||
unread_count,
|
||||
unread_count: unread,
|
||||
},
|
||||
},
|
||||
{
|
||||
attempts: 3,
|
||||
attempts: 1,
|
||||
delay: 0,
|
||||
removeOnComplete: true,
|
||||
removeOnFail: {
|
||||
@ -42,7 +44,7 @@ taskApp
|
||||
);
|
||||
}
|
||||
ctx.body = {
|
||||
job: unread_count,
|
||||
job: unread,
|
||||
};
|
||||
}
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user