From ad756eee10e2d06d4f86976782ba523e4c1b0681 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 19 Jun 2020 10:06:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E7=BC=96=E5=88=B6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/scriptManage/scriptRecord/getActionNew.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/scriptManage/scriptRecord/getActionNew.vue b/src/views/scriptManage/scriptRecord/getActionNew.vue index 3417f70ab..a01eac958 100644 --- a/src/views/scriptManage/scriptRecord/getActionNew.vue +++ b/src/views/scriptManage/scriptRecord/getActionNew.vue @@ -105,6 +105,7 @@ export default { return lastData; }, covertData(memberVOList, element) { + debugger; const member = memberVOList.find(elem=>{ return elem.id == element.memberId; }); const memberName = member.name; switch (element.type) { @@ -127,9 +128,10 @@ export default { } case 'Command': { - const command = CommandHandler.getScriptDefinition(element.operationType); - let operateType = command.operate.split('_')[0]; - const data = command.operate.toUpperCase(); + // const command = CommandHandler.getScriptDefinition(element.operationType); + const commandName = element.operationType; + let operateType = commandName.split('_')[0]; + const data = commandName.toUpperCase(); if (operateType == 'CM') { operateType = 'ControlConvertMenu'; } From f0ae68d94aa42cf0f40f53973909c76f04d07ccd Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 19 Jun 2020 10:23:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.js | 2 +- src/scripts/ProjectConfig.js | 42 ++++++++++++++++++++++++------------ src/store/modules/user.js | 3 ++- src/utils/baseUrl.js | 6 +++--- src/views/login/hydLogin.vue | 2 ++ src/views/login/index.vue | 11 +++++----- 6 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/api/login.js b/src/api/login.js index d996aa4ce..f3daeace4 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -56,7 +56,7 @@ export function checkLoginStatus(sessionId) { sessionId: sessionId } }).then(response => { - if (response.data.status === '2') { + if (response.data.status === 'SCAN') { resolve(response); } else { reject(response); diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index b9a1466ae..a5a3de8fc 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -12,59 +12,71 @@ import { LoginParams } from '@/utils/login'; export const loginInfo = { // 页面title & 退出登录跳转路径 xty: { title: '西安铁路职业技术学院城市轨道交通实训平台', - loginPath: '/xty/login' + loginPath: '/xty/login', + loginParam: 'XTY' }, login: { title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Practical Training Platform' : '城市轨道交通实训平台', - loginPath: '/login' + loginPath: '/login', + loginParam: 'DEFAULT' }, design: { title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Design Platform' : '城市轨道交通设计平台', - loginPath: '/design/login' + loginPath: '/design/login', + loginParam: 'DEFAULT' }, designxty: { title: '西安铁路职业技术学院城市轨道交通设计平台', - loginPath: '/designxty/login' + loginPath: '/designxty/login', + loginParam: 'XTY' }, gzb: { title: '贵州装备制造职业学院城市轨道交通实训平台', - loginPath: '/gzb/login' + loginPath: '/gzb/login', + loginParam: 'GZB' }, designgzb: { title: '贵州装备制造职业学院城市轨道交通设计平台', - loginPath: '/designgzb/login' + loginPath: '/designgzb/login', + loginParam: 'GZB' }, hyd: { title: '城市轨道交通综合行车模拟仿真系统V1.0', loginPath: '/login', - bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273' + bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273', + loginParam: 'DEFAULT' }, designhyd: { title: '城市轨道交通设计平台V1.0', loginPath: '/design/login', - bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273' + bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273', + loginParam: 'DEFAULT' }, xadt: { title: '城市轨道交通实训平台', loginTitle: '调度一部', homeTitle: '调度一部', browserTitle: '西安地铁调度一部城市轨道交通实训平台', - loginPath: '/xadt/login' + loginPath: '/xadt/login', + loginParam: 'DEFAULT' }, designxadt: { title: '城市轨道交通设计平台', loginTitle: '调度一部', homeTitle: '调度一部', browserTitle: '西安地铁调度一部城市轨道交通设计平台', - loginPath: '/designxadt/login' + loginPath: '/designxadt/login', + loginParam: 'DEFAULT' }, jsxt:{ title: '城市轨道交通竞赛平台', - loginPath: '/jsxt/login' + loginPath: '/jsxt/login', + loginParam: 'DEFAULT' }, refereeJsxt:{ title: '城市轨道交通裁判平台', - loginPath: '/refereeJsxt/login' + loginPath: '/refereeJsxt/login', + loginParam: 'DEFAULT' }, jyd: { title: '城市轨道交通实训平台', @@ -72,7 +84,8 @@ export const loginInfo = { // 页面title & 退出登录跳转路径 loginTitle: 'jyd', bottomColumn: '', bottomIcon: Bottom_Jyd, - linkIcon: Link_Jyd + linkIcon: Link_Jyd, + loginParam: 'DEFAULT' }, designjyd: { title: '城市轨道交通设计平台', @@ -80,7 +93,8 @@ export const loginInfo = { // 页面title & 退出登录跳转路径 loginPath: '/designjyd/login', bottomColumn: '', bottomIcon: Bottom_Jyd, - linkIcon: Link_Jyd + linkIcon: Link_Jyd, + loginParam: 'DEFAULT' } }; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index d9a0bcc23..026a5701e 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -71,9 +71,10 @@ const user = { const username = userInfo.username.trim(); const password = userInfo.password.trim(); const type = userInfo.type; + const project = userInfo.project; return new Promise((resolve, reject) => { // 登录系统 - const params = Object.assign({ account: username, password }, type == 'design' ? LoginParams.Design : LoginParams.LianKeTang); + const params = Object.assign({ account: username, password, project:project }, type == 'design' ? LoginParams.Design : LoginParams.LianKeTang); login(params).then(resp => { const token = resp.data; const header = { group: '', 'X-Token': token }; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 66eba28e5..c59924e25 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -4,13 +4,13 @@ export function getBaseUrl() { // BASE_API = 'https://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.41: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'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 - } else { + } else { BASE_API = process.env.VUE_APP_BASE_API; } return BASE_API; diff --git a/src/views/login/hydLogin.vue b/src/views/login/hydLogin.vue index 88193741f..bf191eb9b 100644 --- a/src/views/login/hydLogin.vue +++ b/src/views/login/hydLogin.vue @@ -206,12 +206,14 @@ export default { if (valid) { const model = Object.assign({}, this.loginForm); model.password = md5(model.password); + model.project = loginInfo[this.project].loginParam; model.type = this.modelType; this.loading = true; if (this.isAutoLogin) { Cookies.set(this.cookiesName, model.username, { expires: 2}); Cookies.set(this.cookiesToken, model.password, { expires: 2}); } + console.log(model, '111111111111'); this.$store.dispatch('Login', model).then(() => { this.$store.dispatch('SetAccount', model.username); this.handleLoginSucessRoute(); diff --git a/src/views/login/index.vue b/src/views/login/index.vue index f6b0e4958..b7035e491 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -187,7 +187,7 @@ export default { document.querySelector("link[rel*='icon']").href = loginInfo[this.project].linkIcon || ProjectIcon[this.project]; this.computedAttribute(); if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) { - const model = {'username': Cookies.get(this.cookiesName), 'password': Cookies.get(this.cookiesToken)}; + const model = {'username': Cookies.get(this.cookiesName), 'password': Cookies.get(this.cookiesToken), 'project':loginInfo[this.project].loginParam}; model.type = this.modelType; this.$store.dispatch('Login', model).then(() => { this.$store.dispatch('SetAccount', model.username); @@ -245,7 +245,9 @@ export default { }, loginRefresh() { this.loadingCode = true; - getLoginWmurl(LoginParams[this.loginClient]).then(response => { + const params = LoginParams[this.loginClient]; + params.project = loginInfo[this.project].loginParam; + getLoginWmurl(params).then(response => { this.sessionId = response.data.sessionId; this.loginUrl = response.data.url; this.loadingCode = false; @@ -255,8 +257,7 @@ export default { this.loginUrl = ''; }, 3 * 60 * 1000); this.checkLoginStatus(); - }).catch((error) => { - console.log(error); + }).catch(() => { this.loadingCode = false; this.$messageBox(this.$t('login.getLoginQrCode')); }); @@ -280,7 +281,7 @@ export default { this.handleLoginSucessRoute(); }); }).catch(error => { - if (error.data && error.data.status === '1') { + if (error.data && error.data.status === 'WAIT') { self.scanSuccess = true; } self.checkLoginStatus();