|
@@ -99,11 +99,35 @@ export default {
|
|
|
},
|
|
|
async mounted() {
|
|
|
window._hmt.push(["_trackEvent", "在线考试列表页面", "进入页面"]);
|
|
|
- const res = await this.$http.get(
|
|
|
- "/api/ecs_oe_student/examControl/queryExamList"
|
|
|
- );
|
|
|
|
|
|
- this.courses = res.data;
|
|
|
+ let examListRes;
|
|
|
+ for (let i = 0; i < 4; i++) {
|
|
|
+ examListRes = await this.$http.get(
|
|
|
+ "/api/ecs_oe_student/examControl/queryExamList"
|
|
|
+ );
|
|
|
+ if (examListRes.status === 503) {
|
|
|
+ await new Promise(resolve => setTimeout(() => resolve(), 2000));
|
|
|
+ continue;
|
|
|
+ } else if (examListRes.status === 200) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (examListRes.status !== 200) {
|
|
|
+ window._hmt.push([
|
|
|
+ "_trackEvent",
|
|
|
+ "待考列表获取失败",
|
|
|
+ "调用待考列表获取接口超过失败次数",
|
|
|
+ ]);
|
|
|
+ this.$Message.error({
|
|
|
+ content: "服务器繁忙(503)!请稍后重试。",
|
|
|
+ duration: 15,
|
|
|
+ closable: true,
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ this.courses = examListRes.data;
|
|
|
+ }
|
|
|
|
|
|
try {
|
|
|
const noticeRes = (await this.$http.get(
|