diff --git a/src/store/modules/user.js b/src/store/modules/user.js index d2f399c5d..30a1596f5 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -17,7 +17,8 @@ const user = { admin: false, wxId: '', wxUnionId: '', - account: '' + account: '', + projectDevice: '' }, mutations: { @@ -30,6 +31,9 @@ const user = { SET_NICKNAME: (state, nickname) => { state.nickname = nickname; }, + SET_PROJECTDEVICE: (state, projectDevice) => { + state.projectDevice = projectDevice; + }, SET_ROLES: (state, roles) => { state.roles = roles; }, @@ -111,12 +115,15 @@ const user = { GetInfo({ commit }, token) { return new Promise((resolve, reject) => { getInfo(token).then(response => { - const user = response.data; + const user = response.data.userVO; if (user.roles && user.roles.length > 0) { // 验证返回的roles是否是一个非空数组 commit('SET_ROLES', user.roles); } else { reject('getInfo: roles must be a non-null array !'); } + if (response.data.deviceVO) { + commit('SET_PROJECTDEVICE', response.data.deviceVO.code); + } commit('SET_NAME', user.name); commit('SET_NICKNAME', user.nickname); commit('SET_ID', user.id); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 778caeb7b..c59924e25 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - // BASE_API = 'http://192.168.3.6:9000'; // 旭强 + BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index f85905a94..92740dcd9 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -110,16 +110,17 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth'; import Cookies from 'js-cookie'; import md5 from 'js-md5'; import QrcodeVue from 'qrcode.vue'; -import { getLoginWmurl, checkLoginStatus } from '@/api/login'; +import { getLoginWmurl, checkLoginStatus, getInfo } from '@/api/login'; import { LoginParams } from '@/utils/login'; import bgImg from '@/assets/bg1.jpg'; import bgIbpImg from '@/assets/bg_ibp.png'; import { UrlConfig } from '@/scripts/ConstDic'; import { loginInfo, ProjectIcon, GenerateRouteProjectList, VersionBaseNoShow, MainBodyNoShow} from '@/scripts/ProjectConfig'; -import { removeToken } from '@/utils/auth'; +import { removeToken, getToken } from '@/utils/auth'; import LangStorage from '@/utils/lang'; import FloatPart from './floatPart'; import { getIsSignUp } from '@/api/competition'; +import { getSimulationInfoNew } from '@/api/simulation'; export default { name: 'Login', @@ -373,8 +374,12 @@ export default { this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } }); } } else if (this.$route.query.projectDevice) { - const query = { group: '', drawWay: true }; - this.$router.push({ path: `/trainroom`, query: query }); + getInfo(getToken()).then(res => { + getSimulationInfoNew(res.data.group).then(resp => { + const query = { group: res.data.group, drawWay: true, mapId: resp.data.map.id, lineCode:resp.data.map.lineCode }; + this.$router.push({ path: `/jointTrainingNew`, query: query }); + }); + }); } else if (!this.$route.path.includes('jsxt/login') && !this.$route.path.includes('refereeJsxt/login')) { this.$router.push({ path: this.path }); } else { diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index 5cc03900f..0a891aaf2 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -377,17 +377,18 @@ export default { } }, async getUserRole() { - const res = await getUserRolesNew(this.group); - const data = res.data || {}; - this.userRole = data.userRole; - this.deviceCode = data.deviceCode; - this.ibpPart = data.ibpPart; - if (this.userRole === 'IBP') { - this.showIbp(this.deviceCode); - } else { - this.hideIbp(); - } - return res; + // const res = await getUserRolesNew(this.group); + // const data = res.data || {}; + // this.userRole = data.userRole; + // this.deviceCode = data.deviceCode; + // this.ibpPart = data.ibpPart; + // if (this.userRole === 'IBP') { + // this.showIbp(this.deviceCode); + // } else { + // this.hideIbp(); + // } + // return res; + return ''; }, // 仿真系统 async initLoadDemonData() { diff --git a/src/views/system/deviceManage/add.vue b/src/views/system/deviceManage/add.vue index 0a4711e85..11c7138f9 100644 --- a/src/views/system/deviceManage/add.vue +++ b/src/views/system/deviceManage/add.vue @@ -34,7 +34,10 @@ export default { {label: '信号机', value:'SIGNAL'}, {label: '屏蔽门', value: 'PSD'}, {label: 'IBP盘', value: 'IBP'}, - {label: '车站', value: 'LW'} + {label: '车站', value: 'LW'}, + {label: '教员机', value: 'IM'}, + {label: '行调工作站', value: 'CW'}, + {label: '综合监控', value: 'ISCS'} ], projectList: [{label:'西铁院', value: 'XTY'}, {label: '贵州装备', value:'GZB'}], gatewayList: [] diff --git a/src/views/system/deviceManage/index.vue b/src/views/system/deviceManage/index.vue index e52c609b0..4bd0cff8d 100644 --- a/src/views/system/deviceManage/index.vue +++ b/src/views/system/deviceManage/index.vue @@ -34,7 +34,10 @@ export default { {label: '信号机', value:'SIGNAL'}, {label: '屏蔽门', value: 'PSD'}, {label: 'IBP盘', value: 'IBP'}, - {label: '车站', value: 'LW'} + {label: '现地工作站', value: 'LW'}, + {label: '教员机', value: 'IM'}, + {label: '行调工作站', value: 'CW'}, + {label: '综合监控', value: 'ISCS'} ], projectList: [{label:'西铁院', value: 'XTY'}, {label: '贵州装备', value:'GZB'}], projectMap: { @@ -113,7 +116,7 @@ export default { { name: '登录路径', handleClick: this.getPath, - showControl: (row) => { return row.type === 'LW' || row.type === 'IBP'; } + showControl: (row) => { return row.type !== 'SWITCH' && row.type !== 'SIGNAL' && row.type !== 'PSD'; } } ] } @@ -184,8 +187,10 @@ export default { editConfig(index, row) { if (row.type === 'LW' || row.type === 'IBP') { this.$refs.editConfig.doShow(row); - } else { + } else if (row.type === 'SWITCH' || row.type === 'SIGNAL' || row.type === 'PSD') { this.$refs.editConfigGateway.doShow(row); + } else { + this.$messageBox('暂无配置内容'); } }, reloadTable() {