|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import util from '@/libs/util' |
|
|
|
|
import { Message } from 'element-ui' |
|
|
|
|
import {post,get,del,put} from '@/plugins/requests/index.js' |
|
|
|
|
import { post, get, del, put } from '@/plugins/requests/index.js' |
|
|
|
|
import api from '@/api' |
|
|
|
|
import Cookie from 'js-cookie' |
|
|
|
|
import router from '@/router' |
|
|
|
@ -11,40 +11,39 @@ import router from '@/router' |
|
|
|
|
* 用户信息 |
|
|
|
|
* */ |
|
|
|
|
export default { |
|
|
|
|
namespaced: true, |
|
|
|
|
state: { |
|
|
|
|
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', |
|
|
|
|
userName: '', |
|
|
|
|
schoolId: '', |
|
|
|
|
isManager: false |
|
|
|
|
namespaced: true, |
|
|
|
|
state: { |
|
|
|
|
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', |
|
|
|
|
userName: '', |
|
|
|
|
schoolId: '', |
|
|
|
|
isManager: false |
|
|
|
|
}, |
|
|
|
|
mutations: { |
|
|
|
|
SET_MANAGER: (state, isManager) => { |
|
|
|
|
state.isManager = isManager |
|
|
|
|
}, |
|
|
|
|
mutations: { |
|
|
|
|
SET_MANAGER: (state, isManager) => { |
|
|
|
|
state.isManager = isManager |
|
|
|
|
}, |
|
|
|
|
logout() { |
|
|
|
|
const url = location.href |
|
|
|
|
let href = process.env.NODE_ENV === 'development' ? |
|
|
|
|
`http://${location.hostname}:8082/#/` : |
|
|
|
|
`${url.includes('huorantech.cn') ? `https://www.occupationlab.com` : location.origin}${Cookie.get('manager') ? |
|
|
|
|
'/admin' : |
|
|
|
|
(url.includes('huorantech.cn') || url.includes('izhixinyun.com')) ? |
|
|
|
|
'' : |
|
|
|
|
'/student'}/#/` |
|
|
|
|
let assessmentId = sessionStorage.getItem('assessmentId') |
|
|
|
|
if (assessmentId != 'null' && assessmentId != null && assessmentId != '') { |
|
|
|
|
href += `ass/list` |
|
|
|
|
} else { |
|
|
|
|
const cid = sessionStorage.getItem('cid') |
|
|
|
|
href += `station/preview?courseId=${cid}&curriculumName=银行项目&mallId=${router.currentRoute.query.mallId}` |
|
|
|
|
} |
|
|
|
|
sessionStorage.clear() |
|
|
|
|
location.href = href |
|
|
|
|
}, |
|
|
|
|
logout () { |
|
|
|
|
const isAdmin = Cookie.get('manager') |
|
|
|
|
let href = process.env.NODE_ENV === 'development' ? |
|
|
|
|
`http://${location.hostname}:8082/#/` : |
|
|
|
|
`${location.origin}${isAdmin ? '/admin' : ''}/#/` |
|
|
|
|
if (location.origin === 'http://121.37.12.51') { |
|
|
|
|
href = `http://121.37.12.51/${isAdmin ? 'admin' : 'student'}/#/` |
|
|
|
|
} |
|
|
|
|
let assessmentId = sessionStorage.getItem('assessmentId') |
|
|
|
|
if (assessmentId != 'null' && assessmentId != null && assessmentId != '') { |
|
|
|
|
href += `ass/list` |
|
|
|
|
} else { |
|
|
|
|
const cid = sessionStorage.getItem('cid') |
|
|
|
|
href += `station/preview?courseId=${cid}&curriculumName=银行项目&mallId=${router.currentRoute.query.mallId}` |
|
|
|
|
} |
|
|
|
|
sessionStorage.clear() |
|
|
|
|
location.href = href |
|
|
|
|
}, |
|
|
|
|
actions: { |
|
|
|
|
setManager({ state,commit },isManager) { |
|
|
|
|
commit('SET_MANAGER',isManager) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
actions: { |
|
|
|
|
setManager ({ state, commit }, isManager) { |
|
|
|
|
commit('SET_MANAGER', isManager) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |