Commit 54857fa3c06a9f910304f9235cbafc6dc1bf7340
1 parent
8a092267
下载模板跨域,集团管理员选择角色范围,登出缓存问题
Showing
9 changed files
with
56 additions
and
33 deletions
src/api/axios.js
src/store/index.js
| ... | ... | @@ -112,15 +112,15 @@ const store = new Vuex.Store({ |
| 112 | 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 | 125 | CSLogin({ state, commit }, code) { |
| 126 | 126 | request | ... | ... |
src/views/layout/header/header.vue
| ... | ... | @@ -303,8 +303,8 @@ export default { |
| 303 | 303 | } else { |
| 304 | 304 | localStorage.setItem("token", ""); |
| 305 | 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 | 308 | this.$store.commit("resetTabnavBox"); |
| 309 | 309 | this.$router.push({ |
| 310 | 310 | path: "/login", | ... | ... |
src/views/personal/setUp/student.vue
| ... | ... | @@ -450,9 +450,11 @@ export default { |
| 450 | 450 | let { data, info, status } = await this.$request.studentTemplateUrl(); |
| 451 | 451 | this.loadingDown = false; |
| 452 | 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 | 458 | } else { |
| 457 | 459 | this.$message.error(info); |
| 458 | 460 | } | ... | ... |
src/views/standard/device/index.vue
| ... | ... | @@ -803,9 +803,11 @@ export default { |
| 803 | 803 | id: this.id, |
| 804 | 804 | }); |
| 805 | 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 | 811 | } else { |
| 810 | 812 | this.$message.error(info); |
| 811 | 813 | } | ... | ... |
src/views/standard/setUp/account.vue
| ... | ... | @@ -305,11 +305,13 @@ |
| 305 | 305 | </el-form-item> |
| 306 | 306 | <el-form-item |
| 307 | 307 | label="选择管辖范围:" |
| 308 | - :prop="formAddCount.roleId == 3 ? 'regionId' : 'schoolId'" | |
| 308 | + :prop=" | |
| 309 | + permissionLevel(formAddCount.roleId) == 5 ? 'regionId' : 'schoolId' | |
| 310 | + " | |
| 309 | 311 | > |
| 310 | 312 | <el-col :span="12"> |
| 311 | 313 | <el-select |
| 312 | - v-show="formAddCount.roleId == 3" | |
| 314 | + v-show="permissionLevel(formAddCount.roleId) == 5" | |
| 313 | 315 | class="sel" |
| 314 | 316 | v-model="formAddCount.regionId" |
| 315 | 317 | placeholder="选择管辖范围" |
| ... | ... | @@ -322,7 +324,7 @@ |
| 322 | 324 | ></el-option> |
| 323 | 325 | </el-select> |
| 324 | 326 | <el-select |
| 325 | - v-show="formAddCount.roleId == 4" | |
| 327 | + v-show="permissionLevel(formAddCount.roleId) == 4" | |
| 326 | 328 | class="sel" |
| 327 | 329 | v-model="formAddCount.schoolId" |
| 328 | 330 | placeholder="选择管辖范围" |
| ... | ... | @@ -429,7 +431,9 @@ export default { |
| 429 | 431 | }, |
| 430 | 432 | created() { |
| 431 | 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 | 437 | if (this.role == "ROLE_JITUAN") { |
| 434 | 438 | this._TenantRoleList(); |
| 435 | 439 | this._RegionList(); |
| ... | ... | @@ -440,6 +444,15 @@ export default { |
| 440 | 444 | this._QueryData(4); |
| 441 | 445 | }, |
| 442 | 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 | 456 | async refreshAcc() { |
| 444 | 457 | //长水账号同步 |
| 445 | 458 | if (this.syncLoading) return; |
| ... | ... | @@ -449,7 +462,6 @@ export default { |
| 449 | 462 | if (status === 0) { |
| 450 | 463 | this.$message.success("同步中,请稍后刷新重试~"); |
| 451 | 464 | // this._QueryData(4); |
| 452 | - | |
| 453 | 465 | } else { |
| 454 | 466 | this.$message.error(info); |
| 455 | 467 | } |
| ... | ... | @@ -461,7 +473,7 @@ export default { |
| 461 | 473 | showClose: true, |
| 462 | 474 | message: `成功(${res.data.success})`, |
| 463 | 475 | type: "success", |
| 464 | - duration:5000 | |
| 476 | + duration: 5000, | |
| 465 | 477 | }); |
| 466 | 478 | this.diaUp = false; |
| 467 | 479 | this._QueryData(4); | ... | ... |
src/views/standard/setUp/student.vue
| ... | ... | @@ -288,7 +288,9 @@ export default { |
| 288 | 288 | }, |
| 289 | 289 | async created() { |
| 290 | 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 | 294 | await this._QueryDataGrade(); |
| 293 | 295 | await this._QueryClass(); |
| 294 | 296 | this._QueryData(3); |
| ... | ... | @@ -341,7 +343,7 @@ export default { |
| 341 | 343 | showClose: true, |
| 342 | 344 | message: `成功(${res.data.success})`, |
| 343 | 345 | type: "success", |
| 344 | - duration:5000 | |
| 346 | + duration: 5000, | |
| 345 | 347 | }); |
| 346 | 348 | //导入成功 |
| 347 | 349 | this.diaUp = false; |
| ... | ... | @@ -457,15 +459,17 @@ export default { |
| 457 | 459 | this.$message.error(info); |
| 458 | 460 | } |
| 459 | 461 | }, |
| 460 | - async downExcel() { | |
| 462 | + async downExcel() { | |
| 461 | 463 | this.loadingDown = true; |
| 462 | 464 | let { data, info, status } = |
| 463 | 465 | await this.$request.studentClickerTemplateUrl(); |
| 464 | 466 | this.loadingDown = false; |
| 465 | 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 | 473 | } else { |
| 470 | 474 | this.$message.error(info); |
| 471 | 475 | } | ... | ... |
src/views/standard/setUp/teacher.vue
| ... | ... | @@ -448,7 +448,7 @@ export default { |
| 448 | 448 | showClose: true, |
| 449 | 449 | message: `成功(${res.data.success})`, |
| 450 | 450 | type: "success", |
| 451 | - duration:5000 | |
| 451 | + duration: 5000, | |
| 452 | 452 | }); |
| 453 | 453 | this.diaUp = false; |
| 454 | 454 | this._QueryData(10); |
| ... | ... | @@ -783,9 +783,11 @@ export default { |
| 783 | 783 | let { data, status, info } = await this.$request.teacherTemplate(); |
| 784 | 784 | debugger; |
| 785 | 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 | 791 | } else { |
| 790 | 792 | this.$message.error(info); |
| 791 | 793 | } | ... | ... |