From c8b0df37748973eb4b6fa63a0c0d9b2f01bdeed1 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 6 Jan 2025 15:04:56 +0800 Subject: [PATCH] =?UTF-8?q?token=E6=94=B9=E6=88=90=E5=AD=98sessionStorage?= =?UTF-8?q?=E9=87=8C=E9=9D=A2=EF=BC=88=E4=BF=9D=E8=AF=81=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=8F=AA=E8=83=BD=E5=9C=A8=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E7=9A=84tab=E9=A1=B5=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81=EF=BC=8C=E7=94=B1?= =?UTF-8?q?=E6=AD=A4=E9=81=BF=E5=85=8D=E5=AD=90=E7=B3=BB=E7=BB=9F=E7=9A=84?= =?UTF-8?q?tab=E9=A1=B5=E5=A4=9A=E5=BC=80=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- src/components/quill/index.vue | 2 +- src/layouts/home/index.vue | 4 ++-- src/pages/account/redirect/index.vue | 2 +- src/pages/achievement/info/course.vue | 2 +- src/pages/achievement/info/project.vue | 2 +- src/pages/activity/details/index.vue | 6 +++--- src/pages/activity/list/index.vue | 6 +++--- src/pages/activity/manage/add/index.vue | 2 +- src/pages/activity/manage/manage/matchSignup.vue | 2 +- src/pages/activity/manage/manage/notice.vue | 2 +- src/pages/activity/manage/manage/noticeDetail.vue | 2 +- src/pages/assessment/add/index.vue | 2 +- src/pages/course/add/index.vue | 2 +- src/pages/course/contentSettings/index.vue | 2 +- src/pages/evaluation/list/index.vue | 2 +- src/pages/expSystem/list/index.vue | 2 +- src/pages/information/addarticle/index.vue | 2 +- src/pages/lesson/content/index.vue | 9 +++++---- src/pages/match/add/step1.vue | 2 +- src/pages/match/add/step3.vue | 2 +- src/pages/match/manage/abnormalTeam.vue | 4 ++-- src/pages/match/manage/matchArchList.vue | 2 +- src/pages/match/manage/matchRank.vue | 2 +- src/pages/match/manage/matchSignup.vue | 4 ++-- src/pages/match/manage/notice.vue | 2 +- src/pages/match/manage/noticeDetail.vue | 2 +- src/pages/match/manage/otherArchList.vue | 2 +- src/pages/match/manage/theoryReport.vue | 2 +- src/pages/project/add/index.vue | 2 +- src/pages/project/list/index.vue | 2 +- src/pages/review/list/index.vue | 2 +- src/pages/screen/index.vue | 2 +- src/pages/setting/list/index.vue | 2 +- src/pages/setting/list/info.vue | 2 +- src/pages/station/preview/index.vue | 4 ++-- src/pages/student/list/index.vue | 2 +- src/pages/system/list/logo.vue | 2 +- src/pages/system/list/staff.vue | 2 +- src/pages/theoryExam/index.vue | 4 ++-- src/plugins/requests/index.js | 2 +- src/router/permission.js | 7 ++++--- src/router/routes.js | 9 --------- 43 files changed, 58 insertions(+), 65 deletions(-) diff --git a/src/App.vue b/src/App.vue index 6d10d46..49f9df9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,7 +30,7 @@ export default { //在页面刷新时将vuex里的信息保存到localStorage里 window.addEventListener("beforeunload", () => { sessionStorage.removeItem('handelPermission') - util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey, this.$store.state); + util.session.get(Setting.tokenKey) && util.local.set(Setting.storeKey, this.$store.state); }); }, methods: { diff --git a/src/components/quill/index.vue b/src/components/quill/index.vue index eb73e25..c9fbe56 100644 --- a/src/components/quill/index.vue +++ b/src/components/quill/index.vue @@ -88,7 +88,7 @@ export default { const that = this return { headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, editorType: '0', mdVal: '', diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue index f7ed364..40e6bf2 100644 --- a/src/layouts/home/index.vue +++ b/src/layouts/home/index.vue @@ -160,7 +160,7 @@ export default { }, // 获取日志状态 getLogStatus () { - util.local.get(Setting.tokenKey) && this.$get(this.api.logNotification, { + util.session.get(Setting.tokenKey) && this.$get(this.api.logNotification, { platformId: Setting.platformId }).then(({ notification }) => { this.SET_LOG() // 把查看日志状态设置为true @@ -190,7 +190,7 @@ export default { }; setInterval(() => { - if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) { + if (util.session.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) { util.errorMsg("由于您已经有三个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。"); setTimeout(this.logout, 1500); } diff --git a/src/pages/account/redirect/index.vue b/src/pages/account/redirect/index.vue index e2591d8..5c1de42 100644 --- a/src/pages/account/redirect/index.vue +++ b/src/pages/account/redirect/index.vue @@ -24,7 +24,7 @@ export default { ]), setLogin () { this.SET_FROM(true) - Util.local.set(Setting.tokenKey, window.atob(decodeURI(this.token)), Setting.tokenExpires); + Util.session.set(Setting.tokenKey, window.atob(decodeURI(this.token))) this.getOss() this.getRole() this.queryCustomer() diff --git a/src/pages/achievement/info/course.vue b/src/pages/achievement/info/course.vue index 1be99ce..7f69f3b 100644 --- a/src/pages/achievement/info/course.vue +++ b/src/pages/achievement/info/course.vue @@ -220,7 +220,7 @@ export default { errorAnalysis: [], max: {}, min: {}, - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), detailVisible: false, details: [], multipleSelectionActivation: [], diff --git a/src/pages/achievement/info/project.vue b/src/pages/achievement/info/project.vue index 67270cd..7b84bf3 100644 --- a/src/pages/achievement/info/project.vue +++ b/src/pages/achievement/info/project.vue @@ -206,7 +206,7 @@ export default { errorAnalysis: {}, max: {}, min: {}, - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), curTab: this.$route.query.curTab || '0', tabs: [ { diff --git a/src/pages/activity/details/index.vue b/src/pages/activity/details/index.vue index deef89f..a7c6e6b 100644 --- a/src/pages/activity/details/index.vue +++ b/src/pages/activity/details/index.vue @@ -113,7 +113,7 @@ export default { name: 'matchdetail', data () { return { - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), id: +this.$route.query.id, end: '', status: '', @@ -313,7 +313,7 @@ export default { // 进入python系统 toPython () { const form = this.curStage - let token = util.local.get(Setting.tokenKey); + let token = util.session.get(Setting.tokenKey); util.cookies.set('assessmentId', '', -1) util.cookies.set('startTime', '', -1) util.cookies.set('stopTime', '', -1) @@ -342,7 +342,7 @@ export default { const { systemId, projectId, cid, stageId } = this.curStage const competitionId = form.id const teamId = form.competitionRegistration.teamId - let token = util.local.get(Setting.tokenKey); + let token = util.session.get(Setting.tokenKey); if (systemId == 11) { // 银行系统 location.href = `${Setting.systemPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${cid}&systemId=${systemId}&projectId=${projectId}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&assessmentId=&classId=&stopTime=&test=true` diff --git a/src/pages/activity/list/index.vue b/src/pages/activity/list/index.vue index a918276..b20517c 100644 --- a/src/pages/activity/list/index.vue +++ b/src/pages/activity/list/index.vue @@ -144,7 +144,7 @@ export default { data () { return { timer: null, - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), statusList: ["待报名", "取消报名", "马上报名", "报名截止", "已结束"], endList: ["报名开始", "报名截止", "报名截止", "项目开始", "项目结束"], typeList: [ @@ -398,7 +398,7 @@ export default { // 进入python系统 toPython () { const form = this.curItem.curStage - let token = util.local.get(Setting.tokenKey); + let token = util.session.get(Setting.tokenKey); util.cookies.set('assessmentId', '', -1) util.cookies.set('startTime', '', -1) util.cookies.set('stopTime', '', -1) @@ -427,7 +427,7 @@ export default { const { systemId, projectId, cid, stageId } = form.curStage const competitionId = form.id const teamId = form.teamId - let token = util.local.get(Setting.tokenKey); + let token = util.session.get(Setting.tokenKey); if (systemId == 11) { // 银行系统 location.href = `${Setting.systemPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${cid}&systemId=${systemId}&projectId=${projectId}&competitionId=${competitionId}&stageId=${stageId}&teamId=${teamId}&assessmentId=&classId=&stopTime=&test=true` diff --git a/src/pages/activity/manage/add/index.vue b/src/pages/activity/manage/add/index.vue index aa0be15..7117b22 100644 --- a/src/pages/activity/manage/add/index.vue +++ b/src/pages/activity/manage/add/index.vue @@ -183,7 +183,7 @@ export default { return { id: this.$route.query.id || '', headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, scope: 0, form: { diff --git a/src/pages/activity/manage/manage/matchSignup.vue b/src/pages/activity/manage/manage/matchSignup.vue index 1f9001a..6e5dc6c 100644 --- a/src/pages/activity/manage/manage/matchSignup.vue +++ b/src/pages/activity/manage/manage/matchSignup.vue @@ -60,7 +60,7 @@ export default { name: "matchSignup", data () { return { - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), id: +this.$route.query.id, isDisable: '', statusList: [ diff --git a/src/pages/activity/manage/manage/notice.vue b/src/pages/activity/manage/manage/notice.vue index 1df43d3..ea1db43 100644 --- a/src/pages/activity/manage/manage/notice.vue +++ b/src/pages/activity/manage/manage/notice.vue @@ -47,7 +47,7 @@ import Setting from "@/setting"; export default { data () { return { - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), id: this.$route.query.id, listData: [], multipleSelection: [], diff --git a/src/pages/activity/manage/manage/noticeDetail.vue b/src/pages/activity/manage/manage/noticeDetail.vue index 0c7b771..08b32aa 100644 --- a/src/pages/activity/manage/manage/noticeDetail.vue +++ b/src/pages/activity/manage/manage/noticeDetail.vue @@ -55,7 +55,7 @@ export default { data () { return { headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, form: { id: this.$route.query.id, diff --git a/src/pages/assessment/add/index.vue b/src/pages/assessment/add/index.vue index ec49a54..5999d80 100644 --- a/src/pages/assessment/add/index.vue +++ b/src/pages/assessment/add/index.vue @@ -168,7 +168,7 @@ export default { components: { StudentTree }, data () { return { - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), founderKeys: { 0: "系统", 1: "老师" diff --git a/src/pages/course/add/index.vue b/src/pages/course/add/index.vue index a945b7d..b63a64c 100644 --- a/src/pages/course/add/index.vue +++ b/src/pages/course/add/index.vue @@ -132,7 +132,7 @@ export default { const that = this return { headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, isDetail: Boolean(this.$route.query.show), form: { diff --git a/src/pages/course/contentSettings/index.vue b/src/pages/course/contentSettings/index.vue index f909eaf..ea2a2e1 100644 --- a/src/pages/course/contentSettings/index.vue +++ b/src/pages/course/contentSettings/index.vue @@ -229,7 +229,7 @@ export default { data () { return { headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, id: "", originChapters: [], diff --git a/src/pages/evaluation/list/index.vue b/src/pages/evaluation/list/index.vue index fd3e113..f027ead 100644 --- a/src/pages/evaluation/list/index.vue +++ b/src/pages/evaluation/list/index.vue @@ -201,7 +201,7 @@ export default { data () { return { headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, questionsImport: this.api.questionsImport, topicForm: { diff --git a/src/pages/expSystem/list/index.vue b/src/pages/expSystem/list/index.vue index 7b7089e..666b424 100644 --- a/src/pages/expSystem/list/index.vue +++ b/src/pages/expSystem/list/index.vue @@ -56,7 +56,7 @@ export default { data () { return { isPro: Setting.isPro, - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), systemType: this.$route.query.systemType ? +this.$route.query.systemType : '', keyword: this.$route.query.keyword || '', searchTimer: null, diff --git a/src/pages/information/addarticle/index.vue b/src/pages/information/addarticle/index.vue index 09f863a..bb63978 100644 --- a/src/pages/information/addarticle/index.vue +++ b/src/pages/information/addarticle/index.vue @@ -54,7 +54,7 @@ export default { return { id: this.$route.query.id, headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, form: { columnId: +this.$route.query.columnId, diff --git a/src/pages/lesson/content/index.vue b/src/pages/lesson/content/index.vue index 65252ed..62053eb 100644 --- a/src/pages/lesson/content/index.vue +++ b/src/pages/lesson/content/index.vue @@ -61,7 +61,8 @@ {{ section.name }}
- 下载 + 下载 预览 修改资源名称 @@ -660,7 +661,7 @@ export default { const { fileType, fileId } = row // 下载ppt if (fileType === 'pptx') { - this.downloadFile(row.originalFileName || row.name, row.fileUrl) + Util.downloadFile(row.originalFileName || row.name, row.fileUrl) } else if (fileId) { // 阿里云点播视频,先生成视频,再拿到视频地址去下载(现在已经去掉视频点播的方法,但是还需要兼容历史数据) this.$get(`${this.api.getPlayAuth}/${fileId}`).then(res => { @@ -672,11 +673,11 @@ export default { playauth: res.playAuth, encryptType: 1 //当播放私有加密流时需要设置。 }, player => { - this.downloadFile(row.name, player._urls[0].Url) + Util.downloadFile(row.name, player._urls[0].Url) }) }).catch(res => { }) } else { - this.downloadFile(row.name + '.' + row.fileType, row.fileUrl) + Util.downloadFile(row.name + '.' + row.fileType, row.fileUrl) } }, preview (row) { diff --git a/src/pages/match/add/step1.vue b/src/pages/match/add/step1.vue index cc41e5d..3e93785 100644 --- a/src/pages/match/add/step1.vue +++ b/src/pages/match/add/step1.vue @@ -173,7 +173,7 @@ export default { const that = this return { headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, form: { id: this.$route.query.id || '', diff --git a/src/pages/match/add/step3.vue b/src/pages/match/add/step3.vue index 7cf31c2..2c344c2 100644 --- a/src/pages/match/add/step3.vue +++ b/src/pages/match/add/step3.vue @@ -122,7 +122,7 @@ export default { data () { return { headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, id: this.$route.query.id, updateTime: 0, diff --git a/src/pages/match/manage/abnormalTeam.vue b/src/pages/match/manage/abnormalTeam.vue index 3670b01..088277d 100644 --- a/src/pages/match/manage/abnormalTeam.vue +++ b/src/pages/match/manage/abnormalTeam.vue @@ -153,7 +153,7 @@ import Setting from "@/setting"; export default { data () { return { - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), id: +this.$route.query.id, info: { completeCompetitionSetup: { @@ -238,7 +238,7 @@ export default { uploadTips: '', exportCode: '', headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, uploading: false, isBackstage: 0, diff --git a/src/pages/match/manage/matchArchList.vue b/src/pages/match/manage/matchArchList.vue index 68fa6ff..61b6867 100644 --- a/src/pages/match/manage/matchArchList.vue +++ b/src/pages/match/manage/matchArchList.vue @@ -163,7 +163,7 @@ export default { uploading: false, faildData: null, headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, statData: { avgScore: 0, diff --git a/src/pages/match/manage/matchRank.vue b/src/pages/match/manage/matchRank.vue index 1428553..bcb0f3c 100644 --- a/src/pages/match/manage/matchRank.vue +++ b/src/pages/match/manage/matchRank.vue @@ -200,7 +200,7 @@ export default { } ], headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, active: '', grades: [], diff --git a/src/pages/match/manage/matchSignup.vue b/src/pages/match/manage/matchSignup.vue index ba881fb..7b562f7 100644 --- a/src/pages/match/manage/matchSignup.vue +++ b/src/pages/match/manage/matchSignup.vue @@ -205,7 +205,7 @@ export default { name: "matchSignup", data () { return { - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), schoolId: this.$store.state.user.schoolId, id: +this.$route.query.id, info: { @@ -292,7 +292,7 @@ export default { uploadTips: '', exportCode: '', headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, diffSchool: false, uploading: false, diff --git a/src/pages/match/manage/notice.vue b/src/pages/match/manage/notice.vue index 8c0b50d..5d830b5 100644 --- a/src/pages/match/manage/notice.vue +++ b/src/pages/match/manage/notice.vue @@ -48,7 +48,7 @@ import Setting from "@/setting"; export default { data () { return { - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), id: this.$route.query.id, keyword: "", listData: [], diff --git a/src/pages/match/manage/noticeDetail.vue b/src/pages/match/manage/noticeDetail.vue index 0e8a576..c5084fd 100644 --- a/src/pages/match/manage/noticeDetail.vue +++ b/src/pages/match/manage/noticeDetail.vue @@ -57,7 +57,7 @@ export default { data () { return { headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, form: { id: this.$route.query.id, diff --git a/src/pages/match/manage/otherArchList.vue b/src/pages/match/manage/otherArchList.vue index 71e5875..834c224 100644 --- a/src/pages/match/manage/otherArchList.vue +++ b/src/pages/match/manage/otherArchList.vue @@ -203,7 +203,7 @@ export default { uploading: false, faildData: null, headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, statData: {}, tabs: ['成绩列表', '文件列表'], diff --git a/src/pages/match/manage/theoryReport.vue b/src/pages/match/manage/theoryReport.vue index 55d871f..d7b4b4a 100644 --- a/src/pages/match/manage/theoryReport.vue +++ b/src/pages/match/manage/theoryReport.vue @@ -271,7 +271,7 @@ export default { numToLetter: Util.numToLetter, arabicToChinese: Util.arabicToChinese, reportId: this.$route.query.reportId, - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), title: "实验报告", form: { className: "", diff --git a/src/pages/project/add/index.vue b/src/pages/project/add/index.vue index da83edf..306d26e 100644 --- a/src/pages/project/add/index.vue +++ b/src/pages/project/add/index.vue @@ -197,7 +197,7 @@ export default { systemList: [], mallIds: [], curs: [], - token: btoa(util.local.get(Setting.tokenKey)), + token: btoa(util.session.get(Setting.tokenKey)), isDetail: Boolean(this.$route.query.show), projectManage: { diff --git a/src/pages/project/list/index.vue b/src/pages/project/list/index.vue index a369005..75d9eb4 100644 --- a/src/pages/project/list/index.vue +++ b/src/pages/project/list/index.vue @@ -150,7 +150,7 @@ import qs from 'qs' export default { data () { return { - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), fromAss: Boolean(this.$route.query.show), // 从考核新增里点自定义项目过来的 lc: [11, 12, 19], cid: [this.$route.query.mallId ? +this.$route.query.mallId : '', this.$route.query.cid ? +this.$route.query.cid : ''], diff --git a/src/pages/review/list/index.vue b/src/pages/review/list/index.vue index e7b77d6..90c8b91 100644 --- a/src/pages/review/list/index.vue +++ b/src/pages/review/list/index.vue @@ -11,7 +11,7 @@ export default { data () { return { url: '', - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), }; }, mounted () { diff --git a/src/pages/screen/index.vue b/src/pages/screen/index.vue index 5fc79bf..a415185 100644 --- a/src/pages/screen/index.vue +++ b/src/pages/screen/index.vue @@ -354,7 +354,7 @@ import Setting from '@/setting' export default { data () { return { - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), time: 2, times: [ { diff --git a/src/pages/setting/list/index.vue b/src/pages/setting/list/index.vue index dee0384..b1cc4ec 100644 --- a/src/pages/setting/list/index.vue +++ b/src/pages/setting/list/index.vue @@ -44,7 +44,7 @@ import util from '@/libs/util' export default { data () { return { - token: util.local.get(Setting.tokenKey), + token: util.session.get(Setting.tokenKey), typeList: [ { index: '1', diff --git a/src/pages/setting/list/info.vue b/src/pages/setting/list/info.vue index d28ffe5..5ebf328 100644 --- a/src/pages/setting/list/info.vue +++ b/src/pages/setting/list/info.vue @@ -280,7 +280,7 @@ export default { editUsername: '', accountVisible: false, updateTime: 0, - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), form: { userName: "", name: "", diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index e678418..3de1f0e 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -913,7 +913,7 @@ export default { // 进入python系统 toPython (projectId) { const id = this.systemIds - let token = Util.local.get(Setting.tokenKey); + let token = Util.session.get(Setting.tokenKey); Util.cookies.set('assessmentId', '', -1) Util.cookies.set('startTime', '', -1) Util.cookies.set('stopTime', '', -1) @@ -951,7 +951,7 @@ export default { } const { systemId } = curProject - let token = Util.local.get(Setting.tokenKey); + let token = Util.session.get(Setting.tokenKey); this.third = curProject.type === 2 ? (curProject.systemId === 28 ? 'low' : 'ai') : '' if (systemId == 11) { // 银行系统 diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue index 45279b9..41249a5 100644 --- a/src/pages/student/list/index.vue +++ b/src/pages/student/list/index.vue @@ -335,7 +335,7 @@ export default { uploadFaild: false, exportCode: "", headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, disableds: false, submiting: false, // 新增编辑防抖标识 diff --git a/src/pages/system/list/logo.vue b/src/pages/system/list/logo.vue index 3826a7a..1de8b2c 100644 --- a/src/pages/system/list/logo.vue +++ b/src/pages/system/list/logo.vue @@ -53,7 +53,7 @@ export default { data () { return { headers: { - token: util.local.get(Setting.tokenKey) + token: util.session.get(Setting.tokenKey) }, coverUrl: "", uploadList: [], diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue index accf7e4..68fb240 100644 --- a/src/pages/system/list/staff.vue +++ b/src/pages/system/list/staff.vue @@ -142,7 +142,7 @@ export default { return { exportCode: "", headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, isDetail: false, isAdd: false, diff --git a/src/pages/theoryExam/index.vue b/src/pages/theoryExam/index.vue index 42173d4..c518793 100644 --- a/src/pages/theoryExam/index.vue +++ b/src/pages/theoryExam/index.vue @@ -173,9 +173,9 @@ export default { numToLetter: Util.numToLetter, arabicToChinese: Util.arabicToChinese, headers: { - token: Util.local.get(Setting.tokenKey) + token: Util.session.get(Setting.tokenKey) }, - token: Util.local.get(Setting.tokenKey), + token: Util.session.get(Setting.tokenKey), paperId: +this.$route.query.paperId, // 试卷id(练习专用) cid: +this.$route.query.cid, mallId: +this.$route.query.mallId || '', diff --git a/src/plugins/requests/index.js b/src/plugins/requests/index.js index 7c7ec6d..76aa9d4 100644 --- a/src/plugins/requests/index.js +++ b/src/plugins/requests/index.js @@ -13,7 +13,7 @@ service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8" // 请求拦截器 service.interceptors.request.use(config => { - let token = Util.local.get(Setting.tokenKey); + let token = Util.session.get(Setting.tokenKey); if (token) config.headers.token = token return config; }, err => { diff --git a/src/router/permission.js b/src/router/permission.js index fad0451..8aae291 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -1,13 +1,14 @@ import router from "./index"; import Setting from "@/setting"; import util from "@/libs/util"; +import store from '@/store' const whiteList = Setting.whiteList // 白名单 router.beforeEach((to, from, next) => { - document.title = Setting.titleSuffix; - const role = util.local.get(Setting.tokenKey); + document.title = Setting.titleSuffix + const role = util.session.get(Setting.tokenKey) if (!role && !whiteList.includes(to.path)) { - next('/login') + store.dispatch('user/logout') } else { next() } diff --git a/src/router/routes.js b/src/router/routes.js index ea7653e..f76e722 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -28,15 +28,6 @@ const frameIn = [ */ const frameOut = [ - // 登录 - { - path: "/login", - name: "login", - meta: { - title: "登录" - }, - component: () => import("@/pages/account/login") - }, { path: "/redirect", name: "redirect",