token改成存sessionStorage里面(保证一个账号只能在一个浏览器的tab页保持登录状态,由此避免子系统的tab页多开)

dev_202412
yujialong 2 months ago
parent 33787eadf1
commit c8b0df3774
  1. 2
      src/App.vue
  2. 2
      src/components/quill/index.vue
  3. 4
      src/layouts/home/index.vue
  4. 2
      src/pages/account/redirect/index.vue
  5. 2
      src/pages/achievement/info/course.vue
  6. 2
      src/pages/achievement/info/project.vue
  7. 6
      src/pages/activity/details/index.vue
  8. 6
      src/pages/activity/list/index.vue
  9. 2
      src/pages/activity/manage/add/index.vue
  10. 2
      src/pages/activity/manage/manage/matchSignup.vue
  11. 2
      src/pages/activity/manage/manage/notice.vue
  12. 2
      src/pages/activity/manage/manage/noticeDetail.vue
  13. 2
      src/pages/assessment/add/index.vue
  14. 2
      src/pages/course/add/index.vue
  15. 2
      src/pages/course/contentSettings/index.vue
  16. 2
      src/pages/evaluation/list/index.vue
  17. 2
      src/pages/expSystem/list/index.vue
  18. 2
      src/pages/information/addarticle/index.vue
  19. 9
      src/pages/lesson/content/index.vue
  20. 2
      src/pages/match/add/step1.vue
  21. 2
      src/pages/match/add/step3.vue
  22. 4
      src/pages/match/manage/abnormalTeam.vue
  23. 2
      src/pages/match/manage/matchArchList.vue
  24. 2
      src/pages/match/manage/matchRank.vue
  25. 4
      src/pages/match/manage/matchSignup.vue
  26. 2
      src/pages/match/manage/notice.vue
  27. 2
      src/pages/match/manage/noticeDetail.vue
  28. 2
      src/pages/match/manage/otherArchList.vue
  29. 2
      src/pages/match/manage/theoryReport.vue
  30. 2
      src/pages/project/add/index.vue
  31. 2
      src/pages/project/list/index.vue
  32. 2
      src/pages/review/list/index.vue
  33. 2
      src/pages/screen/index.vue
  34. 2
      src/pages/setting/list/index.vue
  35. 2
      src/pages/setting/list/info.vue
  36. 4
      src/pages/station/preview/index.vue
  37. 2
      src/pages/student/list/index.vue
  38. 2
      src/pages/system/list/logo.vue
  39. 2
      src/pages/system/list/staff.vue
  40. 4
      src/pages/theoryExam/index.vue
  41. 2
      src/plugins/requests/index.js
  42. 7
      src/router/permission.js
  43. 9
      src/router/routes.js

@ -30,7 +30,7 @@ export default {
//vuexlocalStorage
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: {

@ -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: '',

@ -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);
}

@ -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()

@ -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: [],

@ -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: [
{

@ -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`

@ -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`

@ -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: {

@ -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: [

@ -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: [],

@ -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,

@ -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: "老师"

@ -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: {

@ -229,7 +229,7 @@ export default {
data () {
return {
headers: {
token: util.local.get(Setting.tokenKey)
token: util.session.get(Setting.tokenKey)
},
id: "",
originChapters: [],

@ -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: {

@ -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,

@ -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,

@ -61,7 +61,8 @@
<span class="name">{{ section.name }}</span>
</div>
<div class="section-actions">
<el-button type="text" @click="download(section)" v-auth="'/curriculum:内容设置:下载'">下载</el-button>
<el-button type="text" :disabled="section.isDownload === 0" @click="download(section)"
v-auth="'/curriculum:内容设置:下载'">下载</el-button>
<el-button type="text" @click="preview(section)" v-auth="'/curriculum:内容设置:查看'">预览</el-button>
<el-button type="text" @click="editSectionName(section)"
v-auth="'/curriculum:内容设置:修改小节名称'">修改资源名称</el-button>
@ -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) {

@ -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 || '',

@ -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,

@ -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,

@ -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,

@ -200,7 +200,7 @@ export default {
}
],
headers: {
token: Util.local.get(Setting.tokenKey)
token: Util.session.get(Setting.tokenKey)
},
active: '',
grades: [],

@ -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,

@ -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: [],

@ -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,

@ -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: ['成绩列表', '文件列表'],

@ -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: "",

@ -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: {

@ -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 : ''],

@ -11,7 +11,7 @@ export default {
data () {
return {
url: '',
token: Util.local.get(Setting.tokenKey),
token: Util.session.get(Setting.tokenKey),
};
},
mounted () {

@ -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: [
{

@ -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',

@ -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: "",

@ -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) {
//

@ -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, //

@ -53,7 +53,7 @@ export default {
data () {
return {
headers: {
token: util.local.get(Setting.tokenKey)
token: util.session.get(Setting.tokenKey)
},
coverUrl: "",
uploadList: [],

@ -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,

@ -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 || '',

@ -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 => {

@ -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()
}

@ -28,15 +28,6 @@ const frameIn = [
*/
const frameOut = [
// 登录
{
path: "/login",
name: "login",
meta: {
title: "登录"
},
component: () => import("@/pages/account/login")
},
{
path: "/redirect",
name: "redirect",

Loading…
Cancel
Save