fixing response error 404 ส่งออกรายงานสรรหาสอบแข่งขัน
This commit is contained in:
parent
c49e34982d
commit
71b5de5683
2 changed files with 42 additions and 15 deletions
|
|
@ -408,7 +408,13 @@ const downloadPassExam = async () => {
|
|||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
messageError(
|
||||
$q,
|
||||
e,
|
||||
rows.value.length == 0
|
||||
? "ไม่พบข้อมูลผลการสอบ กรุณาตรวจสอบความถูกต้องอีกครั้ง!"
|
||||
: ""
|
||||
);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -429,7 +435,13 @@ const downloadPassResultExam = async () => {
|
|||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
messageError(
|
||||
$q,
|
||||
e,
|
||||
rows.value.length == 0
|
||||
? "ไม่พบข้อมูลผลการสอบ กรุณาตรวจสอบความถูกต้องอีกครั้ง!"
|
||||
: ""
|
||||
);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
}
|
||||
}
|
||||
|
||||
const messageError = (q: any, e: any = "") => {
|
||||
const messageError = (q: any, e: any = "", msg: string = "") => {
|
||||
// q.dialog.hide();
|
||||
if (e.response !== undefined) {
|
||||
if (e.response.data.status !== undefined) {
|
||||
|
|
@ -411,22 +411,37 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
},
|
||||
});
|
||||
} else {
|
||||
console.log("errror===>", e);
|
||||
console.error(e.response.data); // ***
|
||||
console.error(e.response.status); // ***
|
||||
|
||||
q.dialog({
|
||||
component: CustomComponent,
|
||||
componentProps: {
|
||||
title: `พบข้อผิดพลาด`,
|
||||
message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`,
|
||||
icon: "warning",
|
||||
color: "red",
|
||||
onlycancel: true,
|
||||
},
|
||||
});
|
||||
if (e.response.status == 404) {
|
||||
q.dialog({
|
||||
component: CustomComponent,
|
||||
componentProps: {
|
||||
title: `พบข้อผิดพลาด`,
|
||||
message: msg,
|
||||
icon: "warning",
|
||||
color: "red",
|
||||
onlycancel: true,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
q.dialog({
|
||||
component: CustomComponent,
|
||||
componentProps: {
|
||||
title: `พบข้อผิดพลาด`,
|
||||
message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`,
|
||||
icon: "warning",
|
||||
color: "red",
|
||||
onlycancel: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log("errror===>", e);
|
||||
console.error(e.response.data); // ***
|
||||
console.error(e.response.status); // ***
|
||||
|
||||
q.dialog({
|
||||
component: CustomComponent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue