diff --git a/src/api/axios.js b/src/api/axios.js index e1ed38c..0c3632d 100644 --- a/src/api/axios.js +++ b/src/api/axios.js @@ -81,7 +81,7 @@ service.interceptors.response.use( }); router.push({ path: "/login" }); } - return + return Promise.resolve(data); } Message.closeAll(); Message({ diff --git a/src/store/index.js b/src/store/index.js index b3d3e25..dd7c510 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -112,15 +112,15 @@ const store = new Vuex.Store({ duration: 3 * 1000, }); } - } else { - Message({ - message: response.info, - type: "error", - duration: 3 * 1000, - }); } }) - .catch(() => { }); + .catch((err) => { + Message({ + message: err, + type: "error", + duration: 3 * 1000, + }); + }); }, CSLogin({ state, commit }, code) { request diff --git a/src/views/layout/header/header.vue b/src/views/layout/header/header.vue index 0c9808b..703114b 100644 --- a/src/views/layout/header/header.vue +++ b/src/views/layout/header/header.vue @@ -303,8 +303,8 @@ export default { } else { localStorage.setItem("token", ""); this.$store.commit("setToken", ""); - this.$store.commit("setInfo", {}); - this.$store.commit("setRouters", []); + this.$store.commit("setInfo", ""); + this.$store.commit("setRouters", ""); this.$store.commit("resetTabnavBox"); this.$router.push({ path: "/login", diff --git a/src/views/personal/setUp/student.vue b/src/views/personal/setUp/student.vue index 31f7c14..c10a676 100644 --- a/src/views/personal/setUp/student.vue +++ b/src/views/personal/setUp/student.vue @@ -450,9 +450,11 @@ export default { let { data, info, status } = await this.$request.studentTemplateUrl(); this.loadingDown = false; if (status == 0) { - getBlob(data.downloadUrl).then((res) => { - downloadFile("学生模板", res); - }); + const a = document.createElement("a"); + a.href = data.downloadUrl; + document.body.appendChild(a); + a.click(); + a.remove(); } else { this.$message.error(info); } diff --git a/src/views/standard/device/index.vue b/src/views/standard/device/index.vue index b735ecf..4573262 100644 --- a/src/views/standard/device/index.vue +++ b/src/views/standard/device/index.vue @@ -803,9 +803,11 @@ export default { id: this.id, }); if (status == 0) { - getBlob(data.downloadUrl).then((res) => { - downloadFile("基站模版", res); - }); + const a = document.createElement("a"); + a.href = data.downloadUrl; + document.body.appendChild(a); + a.click(); + a.remove(); } else { this.$message.error(info); } diff --git a/src/views/standard/setUp/account.vue b/src/views/standard/setUp/account.vue index bb73453..fd4f698 100644 --- a/src/views/standard/setUp/account.vue +++ b/src/views/standard/setUp/account.vue @@ -305,11 +305,13 @@ { + if (item.id == id) { + permissionLevel = item.permissionLevel; + } + }); + return permissionLevel; + }, async refreshAcc() { //长水账号同步 if (this.syncLoading) return; @@ -449,7 +462,6 @@ export default { if (status === 0) { this.$message.success("同步中,请稍后刷新重试~"); // this._QueryData(4); - } else { this.$message.error(info); } @@ -461,7 +473,7 @@ export default { showClose: true, message: `成功(${res.data.success})`, type: "success", - duration:5000 + duration: 5000, }); this.diaUp = false; this._QueryData(4); diff --git a/src/views/standard/setUp/student.vue b/src/views/standard/setUp/student.vue index bee7f5c..744f2ca 100644 --- a/src/views/standard/setUp/student.vue +++ b/src/views/standard/setUp/student.vue @@ -288,7 +288,9 @@ export default { }, async created() { this.code = localStorage.getItem("csCode") || ""; - this.role = this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; + this.role = + this.$store.getters.info.showRole || + this.$store.getters.info.permissions[0].role; await this._QueryDataGrade(); await this._QueryClass(); this._QueryData(3); @@ -341,7 +343,7 @@ export default { showClose: true, message: `成功(${res.data.success})`, type: "success", - duration:5000 + duration: 5000, }); //导入成功 this.diaUp = false; @@ -457,15 +459,17 @@ export default { this.$message.error(info); } }, - async downExcel() { + async downExcel() { this.loadingDown = true; let { data, info, status } = await this.$request.studentClickerTemplateUrl(); this.loadingDown = false; if (status == 0) { - getBlob(data.downloadUrl).then((res) => { - downloadFile("学生答题器绑定模板", res); - }); + const a = document.createElement("a"); + a.href = data.downloadUrl; + document.body.appendChild(a); + a.click(); + a.remove(); } else { this.$message.error(info); } diff --git a/src/views/standard/setUp/teacher.vue b/src/views/standard/setUp/teacher.vue index 2aacf5e..5ddf116 100644 --- a/src/views/standard/setUp/teacher.vue +++ b/src/views/standard/setUp/teacher.vue @@ -448,7 +448,7 @@ export default { showClose: true, message: `成功(${res.data.success})`, type: "success", - duration:5000 + duration: 5000, }); this.diaUp = false; this._QueryData(10); @@ -783,9 +783,11 @@ export default { let { data, status, info } = await this.$request.teacherTemplate(); debugger; if (status == 0) { - getBlob(data.downloadUrl).then((res) => { - downloadFile("教师名单模板", res); - }); + const a = document.createElement("a"); + a.href = data.downloadUrl; + document.body.appendChild(a); + a.click(); + a.remove(); } else { this.$message.error(info); } diff --git a/vue.config.js b/vue.config.js index 936163a..7f67187 100644 --- a/vue.config.js +++ b/vue.config.js @@ -22,7 +22,8 @@ module.exports = { }, proxy: { "/": { - target:"http://121.40.127.171", + // target:"http://121.40.127.171", + target:"http://ezquiz.sunvotecloud.cn", changeOrigin: true, ws:true, },