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 }}