Commit 54857fa3c06a9f910304f9235cbafc6dc1bf7340
1 parent
8a092267
下载模板跨域,集团管理员选择角色范围,登出缓存问题
Showing
9 changed files
with
56 additions
and
33 deletions
src/api/axios.js
@@ -81,7 +81,7 @@ service.interceptors.response.use( | @@ -81,7 +81,7 @@ service.interceptors.response.use( | ||
81 | }); | 81 | }); |
82 | router.push({ path: "/login" }); | 82 | router.push({ path: "/login" }); |
83 | } | 83 | } |
84 | - return | 84 | + return Promise.resolve(data); |
85 | } | 85 | } |
86 | Message.closeAll(); | 86 | Message.closeAll(); |
87 | Message({ | 87 | Message({ |
src/store/index.js
@@ -112,15 +112,15 @@ const store = new Vuex.Store({ | @@ -112,15 +112,15 @@ const store = new Vuex.Store({ | ||
112 | duration: 3 * 1000, | 112 | duration: 3 * 1000, |
113 | }); | 113 | }); |
114 | } | 114 | } |
115 | - } else { | ||
116 | - Message({ | ||
117 | - message: response.info, | ||
118 | - type: "error", | ||
119 | - duration: 3 * 1000, | ||
120 | - }); | ||
121 | } | 115 | } |
122 | }) | 116 | }) |
123 | - .catch(() => { }); | 117 | + .catch((err) => { |
118 | + Message({ | ||
119 | + message: err, | ||
120 | + type: "error", | ||
121 | + duration: 3 * 1000, | ||
122 | + }); | ||
123 | + }); | ||
124 | }, | 124 | }, |
125 | CSLogin({ state, commit }, code) { | 125 | CSLogin({ state, commit }, code) { |
126 | request | 126 | request |
src/views/layout/header/header.vue
@@ -303,8 +303,8 @@ export default { | @@ -303,8 +303,8 @@ export default { | ||
303 | } else { | 303 | } else { |
304 | localStorage.setItem("token", ""); | 304 | localStorage.setItem("token", ""); |
305 | this.$store.commit("setToken", ""); | 305 | this.$store.commit("setToken", ""); |
306 | - this.$store.commit("setInfo", {}); | ||
307 | - this.$store.commit("setRouters", []); | 306 | + this.$store.commit("setInfo", ""); |
307 | + this.$store.commit("setRouters", ""); | ||
308 | this.$store.commit("resetTabnavBox"); | 308 | this.$store.commit("resetTabnavBox"); |
309 | this.$router.push({ | 309 | this.$router.push({ |
310 | path: "/login", | 310 | path: "/login", |
src/views/personal/setUp/student.vue
@@ -450,9 +450,11 @@ export default { | @@ -450,9 +450,11 @@ export default { | ||
450 | let { data, info, status } = await this.$request.studentTemplateUrl(); | 450 | let { data, info, status } = await this.$request.studentTemplateUrl(); |
451 | this.loadingDown = false; | 451 | this.loadingDown = false; |
452 | if (status == 0) { | 452 | if (status == 0) { |
453 | - getBlob(data.downloadUrl).then((res) => { | ||
454 | - downloadFile("学生模板", res); | ||
455 | - }); | 453 | + const a = document.createElement("a"); |
454 | + a.href = data.downloadUrl; | ||
455 | + document.body.appendChild(a); | ||
456 | + a.click(); | ||
457 | + a.remove(); | ||
456 | } else { | 458 | } else { |
457 | this.$message.error(info); | 459 | this.$message.error(info); |
458 | } | 460 | } |
src/views/standard/device/index.vue
@@ -803,9 +803,11 @@ export default { | @@ -803,9 +803,11 @@ export default { | ||
803 | id: this.id, | 803 | id: this.id, |
804 | }); | 804 | }); |
805 | if (status == 0) { | 805 | if (status == 0) { |
806 | - getBlob(data.downloadUrl).then((res) => { | ||
807 | - downloadFile("基站模版", res); | ||
808 | - }); | 806 | + const a = document.createElement("a"); |
807 | + a.href = data.downloadUrl; | ||
808 | + document.body.appendChild(a); | ||
809 | + a.click(); | ||
810 | + a.remove(); | ||
809 | } else { | 811 | } else { |
810 | this.$message.error(info); | 812 | this.$message.error(info); |
811 | } | 813 | } |
src/views/standard/setUp/account.vue
@@ -305,11 +305,13 @@ | @@ -305,11 +305,13 @@ | ||
305 | </el-form-item> | 305 | </el-form-item> |
306 | <el-form-item | 306 | <el-form-item |
307 | label="选择管辖范围:" | 307 | label="选择管辖范围:" |
308 | - :prop="formAddCount.roleId == 3 ? 'regionId' : 'schoolId'" | 308 | + :prop=" |
309 | + permissionLevel(formAddCount.roleId) == 5 ? 'regionId' : 'schoolId' | ||
310 | + " | ||
309 | > | 311 | > |
310 | <el-col :span="12"> | 312 | <el-col :span="12"> |
311 | <el-select | 313 | <el-select |
312 | - v-show="formAddCount.roleId == 3" | 314 | + v-show="permissionLevel(formAddCount.roleId) == 5" |
313 | class="sel" | 315 | class="sel" |
314 | v-model="formAddCount.regionId" | 316 | v-model="formAddCount.regionId" |
315 | placeholder="选择管辖范围" | 317 | placeholder="选择管辖范围" |
@@ -322,7 +324,7 @@ | @@ -322,7 +324,7 @@ | ||
322 | ></el-option> | 324 | ></el-option> |
323 | </el-select> | 325 | </el-select> |
324 | <el-select | 326 | <el-select |
325 | - v-show="formAddCount.roleId == 4" | 327 | + v-show="permissionLevel(formAddCount.roleId) == 4" |
326 | class="sel" | 328 | class="sel" |
327 | v-model="formAddCount.schoolId" | 329 | v-model="formAddCount.schoolId" |
328 | placeholder="选择管辖范围" | 330 | placeholder="选择管辖范围" |
@@ -429,7 +431,9 @@ export default { | @@ -429,7 +431,9 @@ export default { | ||
429 | }, | 431 | }, |
430 | created() { | 432 | created() { |
431 | this.code = localStorage.getItem("csCode") || ""; | 433 | this.code = localStorage.getItem("csCode") || ""; |
432 | - this.role = this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; | 434 | + this.role = |
435 | + this.$store.getters.info.showRole || | ||
436 | + this.$store.getters.info.permissions[0].role; | ||
433 | if (this.role == "ROLE_JITUAN") { | 437 | if (this.role == "ROLE_JITUAN") { |
434 | this._TenantRoleList(); | 438 | this._TenantRoleList(); |
435 | this._RegionList(); | 439 | this._RegionList(); |
@@ -440,6 +444,15 @@ export default { | @@ -440,6 +444,15 @@ export default { | ||
440 | this._QueryData(4); | 444 | this._QueryData(4); |
441 | }, | 445 | }, |
442 | methods: { | 446 | methods: { |
447 | + permissionLevel(id) { | ||
448 | + let permissionLevel; | ||
449 | + this.tenantRoleList.map((item) => { | ||
450 | + if (item.id == id) { | ||
451 | + permissionLevel = item.permissionLevel; | ||
452 | + } | ||
453 | + }); | ||
454 | + return permissionLevel; | ||
455 | + }, | ||
443 | async refreshAcc() { | 456 | async refreshAcc() { |
444 | //长水账号同步 | 457 | //长水账号同步 |
445 | if (this.syncLoading) return; | 458 | if (this.syncLoading) return; |
@@ -449,7 +462,6 @@ export default { | @@ -449,7 +462,6 @@ export default { | ||
449 | if (status === 0) { | 462 | if (status === 0) { |
450 | this.$message.success("同步中,请稍后刷新重试~"); | 463 | this.$message.success("同步中,请稍后刷新重试~"); |
451 | // this._QueryData(4); | 464 | // this._QueryData(4); |
452 | - | ||
453 | } else { | 465 | } else { |
454 | this.$message.error(info); | 466 | this.$message.error(info); |
455 | } | 467 | } |
@@ -461,7 +473,7 @@ export default { | @@ -461,7 +473,7 @@ export default { | ||
461 | showClose: true, | 473 | showClose: true, |
462 | message: `成功(${res.data.success})`, | 474 | message: `成功(${res.data.success})`, |
463 | type: "success", | 475 | type: "success", |
464 | - duration:5000 | 476 | + duration: 5000, |
465 | }); | 477 | }); |
466 | this.diaUp = false; | 478 | this.diaUp = false; |
467 | this._QueryData(4); | 479 | this._QueryData(4); |
src/views/standard/setUp/student.vue
@@ -288,7 +288,9 @@ export default { | @@ -288,7 +288,9 @@ export default { | ||
288 | }, | 288 | }, |
289 | async created() { | 289 | async created() { |
290 | this.code = localStorage.getItem("csCode") || ""; | 290 | this.code = localStorage.getItem("csCode") || ""; |
291 | - this.role = this.$store.getters.info.showRole || this.$store.getters.info.permissions[0].role; | 291 | + this.role = |
292 | + this.$store.getters.info.showRole || | ||
293 | + this.$store.getters.info.permissions[0].role; | ||
292 | await this._QueryDataGrade(); | 294 | await this._QueryDataGrade(); |
293 | await this._QueryClass(); | 295 | await this._QueryClass(); |
294 | this._QueryData(3); | 296 | this._QueryData(3); |
@@ -341,7 +343,7 @@ export default { | @@ -341,7 +343,7 @@ export default { | ||
341 | showClose: true, | 343 | showClose: true, |
342 | message: `成功(${res.data.success})`, | 344 | message: `成功(${res.data.success})`, |
343 | type: "success", | 345 | type: "success", |
344 | - duration:5000 | 346 | + duration: 5000, |
345 | }); | 347 | }); |
346 | //导入成功 | 348 | //导入成功 |
347 | this.diaUp = false; | 349 | this.diaUp = false; |
@@ -457,15 +459,17 @@ export default { | @@ -457,15 +459,17 @@ export default { | ||
457 | this.$message.error(info); | 459 | this.$message.error(info); |
458 | } | 460 | } |
459 | }, | 461 | }, |
460 | - async downExcel() { | 462 | + async downExcel() { |
461 | this.loadingDown = true; | 463 | this.loadingDown = true; |
462 | let { data, info, status } = | 464 | let { data, info, status } = |
463 | await this.$request.studentClickerTemplateUrl(); | 465 | await this.$request.studentClickerTemplateUrl(); |
464 | this.loadingDown = false; | 466 | this.loadingDown = false; |
465 | if (status == 0) { | 467 | if (status == 0) { |
466 | - getBlob(data.downloadUrl).then((res) => { | ||
467 | - downloadFile("学生答题器绑定模板", res); | ||
468 | - }); | 468 | + const a = document.createElement("a"); |
469 | + a.href = data.downloadUrl; | ||
470 | + document.body.appendChild(a); | ||
471 | + a.click(); | ||
472 | + a.remove(); | ||
469 | } else { | 473 | } else { |
470 | this.$message.error(info); | 474 | this.$message.error(info); |
471 | } | 475 | } |
src/views/standard/setUp/teacher.vue
@@ -448,7 +448,7 @@ export default { | @@ -448,7 +448,7 @@ export default { | ||
448 | showClose: true, | 448 | showClose: true, |
449 | message: `成功(${res.data.success})`, | 449 | message: `成功(${res.data.success})`, |
450 | type: "success", | 450 | type: "success", |
451 | - duration:5000 | 451 | + duration: 5000, |
452 | }); | 452 | }); |
453 | this.diaUp = false; | 453 | this.diaUp = false; |
454 | this._QueryData(10); | 454 | this._QueryData(10); |
@@ -783,9 +783,11 @@ export default { | @@ -783,9 +783,11 @@ export default { | ||
783 | let { data, status, info } = await this.$request.teacherTemplate(); | 783 | let { data, status, info } = await this.$request.teacherTemplate(); |
784 | debugger; | 784 | debugger; |
785 | if (status == 0) { | 785 | if (status == 0) { |
786 | - getBlob(data.downloadUrl).then((res) => { | ||
787 | - downloadFile("教师名单模板", res); | ||
788 | - }); | 786 | + const a = document.createElement("a"); |
787 | + a.href = data.downloadUrl; | ||
788 | + document.body.appendChild(a); | ||
789 | + a.click(); | ||
790 | + a.remove(); | ||
789 | } else { | 791 | } else { |
790 | this.$message.error(info); | 792 | this.$message.error(info); |
791 | } | 793 | } |
vue.config.js
@@ -22,7 +22,8 @@ module.exports = { | @@ -22,7 +22,8 @@ module.exports = { | ||
22 | }, | 22 | }, |
23 | proxy: { | 23 | proxy: { |
24 | "/": { | 24 | "/": { |
25 | - target:"http://121.40.127.171", | 25 | + // target:"http://121.40.127.171", |
26 | + target:"http://ezquiz.sunvotecloud.cn", | ||
26 | changeOrigin: true, | 27 | changeOrigin: true, |
27 | ws:true, | 28 | ws:true, |
28 | }, | 29 | }, |