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