Skip to content

Commit

Permalink
🐛 fix(task): 客户端拉取任失败处理
Browse files Browse the repository at this point in the history
  • Loading branch information
Teeoo committed Nov 30, 2021
1 parent 9ae8cb1 commit 7303b90
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/pages/task.vue
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,35 @@ export default defineComponent({
item.expand = true;
taskSubList.value = await api.get(item.row.job.target);
} catch (e) {
const notify = $q.notify({
type: 'negative',
position: 'top',
group: false,
timeout: 0,
spinner: true,
message: '获取订阅信息失败,即将尝试从服务器端获取该订阅内容'
});
setTimeout(() => {
api.get(`data?type=stream&url=${item.row.job.target}`).then(d => {
taskSubList.value = d as unknown as TaskSub;
notify({
type: 'positive',
icon: 'done',
spinner: false,
/* eslint-disable @typescript-eslint/no-non-null-assertion */
message: `成功获取任务${taskSubList.value.list!.length}条`,
timeout: 2500
});
}).catch(() => {
notify({
type: 'negative',
icon: 'done',
spinner: false,
message: '获取订阅任务失败',
timeout: 2500
});
});
}, 3000);
}
};
Expand Down

0 comments on commit 7303b90

Please sign in to comment.