From 929c584cd4ca243c7210a882368eaba4997301c6 Mon Sep 17 00:00:00 2001 From: dplcz <1061281835@qq.com> Date: Thu, 3 Nov 2022 08:15:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E9=86=92=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ActTable.vue | 10 +++++----- components/AwardTable.vue | 4 ++-- components/ManageLogin.vue | 6 +++--- components/ProjectTable.vue | 4 ++-- components/TeacherTable.vue | 4 ++-- pages/man-index.vue | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/components/ActTable.vue b/components/ActTable.vue index e2fb99d2..a66ecd89 100644 --- a/components/ActTable.vue +++ b/components/ActTable.vue @@ -318,7 +318,7 @@ export default { } ).catch((err) => { if (err.response.status == 401 || err.response.status == 422) { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); // this.$router.push("/man-login"); } }); @@ -335,7 +335,7 @@ export default { withCredentials: true, }).catch((err) => { if (err.response.status == 401 || err.response.status == 422) { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); this.$router.push("/man-login"); } }); @@ -351,14 +351,14 @@ export default { if (!valid) return; const res = await this.$axios.post("/man/insert/activity", this.addForm, {withCredentials: true}).catch((err) => { if (err.response.status == 401 || err.response.status == 422) { - alert("验证过期,请重新登录") + this.$message.error("验证过期,请重新登录") this.$router.push("/man-login"); } else { this.$message.error("操作失败"); } }); - console.log(res) - if (res['code'] != 0) { + // console.log(res) + if (res.status != 201) { return this.$message.error("操作失败"); } this.$message.success("操作成功"); diff --git a/components/AwardTable.vue b/components/AwardTable.vue index e9c45d66..3b3617e2 100644 --- a/components/AwardTable.vue +++ b/components/AwardTable.vue @@ -276,7 +276,7 @@ export default { withCredentials: true, } ).catch((err) => { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); this.$router.push("/man-login"); }); if (award["code"] != 0) return; @@ -291,7 +291,7 @@ export default { withCredentials: true, }).catch((err) => { if (err.response.status == 401 || err.response.status == 422) { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); this.$router.push("/man-login"); } }); diff --git a/components/ManageLogin.vue b/components/ManageLogin.vue index 0773a89c..01f0aa1c 100644 --- a/components/ManageLogin.vue +++ b/components/ManageLogin.vue @@ -77,7 +77,7 @@ export default { async login(submit_flag) { if (submit_flag) { if (this.username == "" || this.password == "") { - alert("请输入用户名或密码"); + this.$message.error("请输入用户名或密码"); } else { let formData = new FormData(); formData.append("username", this.username); @@ -90,11 +90,11 @@ export default { this.$router.push("/man-index"); // console.log(res.headers); } else { - alert("账号或者密码有误,请重新登录"); + this.$message.error("账号或者密码有误,请重新登录"); } }) .catch((error) => { - alert("账号或者密码有误,请重新登录"); + this.$message.error("账号或者密码有误,请重新登录"); }); } } else { diff --git a/components/ProjectTable.vue b/components/ProjectTable.vue index d3e2ba29..716735ad 100644 --- a/components/ProjectTable.vue +++ b/components/ProjectTable.vue @@ -262,7 +262,7 @@ export default { withCredentials: true, } ).catch((err) => { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); this.$router.push("/man-login"); }); if (project["code"] != 0) return; @@ -278,7 +278,7 @@ export default { withCredentials: true, }).catch((err) => { if (err.response.status == 401 || err.response.status == 422) { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); this.$router.push("/man-login"); } }); diff --git a/components/TeacherTable.vue b/components/TeacherTable.vue index 83088d58..b12190b4 100644 --- a/components/TeacherTable.vue +++ b/components/TeacherTable.vue @@ -246,7 +246,7 @@ export default { withCredentials: true, } ).catch((err) => { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); this.$router.push("/man-login"); }); if (teacherList["code"] != 0) return; @@ -261,7 +261,7 @@ export default { withCredentials: true, }).catch((err) => { if (err.response.status == 401 || err.response.status == 422) { - alert("验证过期,请重新登录"); + this.$message.error("验证过期,请重新登录"); this.$router.push("/man-login"); } }); diff --git a/pages/man-index.vue b/pages/man-index.vue index 139338e2..1d6bc0b1 100644 --- a/pages/man-index.vue +++ b/pages/man-index.vue @@ -106,7 +106,7 @@ export default { }; }, created() { - // this.judgeLogin(); + this.judgeLogin(); }, methods: { change(nu) { @@ -120,7 +120,7 @@ export default { }) .catch((error) => { // console.log(error); - alert("验证过期,请重新登录"); + this.$message.warning("验证过期,请重新登录") this.$router.push("/man-login"); }); },