merge baseurl

This commit is contained in:
sunzhenyu 2020-06-19 11:26:40 +08:00
commit 4a831d4aa7
6 changed files with 44 additions and 24 deletions

View File

@ -56,7 +56,7 @@ export function checkLoginStatus(sessionId) {
sessionId: sessionId sessionId: sessionId
} }
}).then(response => { }).then(response => {
if (response.data.status === '2') { if (response.data.status === 'SCAN') {
resolve(response); resolve(response);
} else { } else {
reject(response); reject(response);

View File

@ -12,59 +12,71 @@ import { LoginParams } from '@/utils/login';
export const loginInfo = { // 页面title & 退出登录跳转路径 export const loginInfo = { // 页面title & 退出登录跳转路径
xty: { xty: {
title: '西安铁路职业技术学院城市轨道交通实训平台', title: '西安铁路职业技术学院城市轨道交通实训平台',
loginPath: '/xty/login' loginPath: '/xty/login',
loginParam: 'XTY'
}, },
login: { login: {
title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Practical Training Platform' : '城市轨道交通实训平台', title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Practical Training Platform' : '城市轨道交通实训平台',
loginPath: '/login' loginPath: '/login',
loginParam: 'DEFAULT'
}, },
design: { design: {
title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Design Platform' : '城市轨道交通设计平台', title: LangStorage.getLang() == 'en' ? ' Urban Rail Transit Design Platform' : '城市轨道交通设计平台',
loginPath: '/design/login' loginPath: '/design/login',
loginParam: 'DEFAULT'
}, },
designxty: { designxty: {
title: '西安铁路职业技术学院城市轨道交通设计平台', title: '西安铁路职业技术学院城市轨道交通设计平台',
loginPath: '/designxty/login' loginPath: '/designxty/login',
loginParam: 'XTY'
}, },
gzb: { gzb: {
title: '贵州装备制造职业学院城市轨道交通实训平台', title: '贵州装备制造职业学院城市轨道交通实训平台',
loginPath: '/gzb/login' loginPath: '/gzb/login',
loginParam: 'GZB'
}, },
designgzb: { designgzb: {
title: '贵州装备制造职业学院城市轨道交通设计平台', title: '贵州装备制造职业学院城市轨道交通设计平台',
loginPath: '/designgzb/login' loginPath: '/designgzb/login',
loginParam: 'GZB'
}, },
hyd: { hyd: {
title: '城市轨道交通综合行车模拟仿真系统V1.0', title: '城市轨道交通综合行车模拟仿真系统V1.0',
loginPath: '/login', loginPath: '/login',
bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273' bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273',
loginParam: 'DEFAULT'
}, },
designhyd: { designhyd: {
title: '城市轨道交通设计平台V1.0', title: '城市轨道交通设计平台V1.0',
loginPath: '/design/login', loginPath: '/design/login',
bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273' bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273',
loginParam: 'DEFAULT'
}, },
xadt: { xadt: {
title: '城市轨道交通实训平台', title: '城市轨道交通实训平台',
loginTitle: '调度一部', loginTitle: '调度一部',
homeTitle: '调度一部', homeTitle: '调度一部',
browserTitle: '西安地铁调度一部城市轨道交通实训平台', browserTitle: '西安地铁调度一部城市轨道交通实训平台',
loginPath: '/xadt/login' loginPath: '/xadt/login',
loginParam: 'DEFAULT'
}, },
designxadt: { designxadt: {
title: '城市轨道交通设计平台', title: '城市轨道交通设计平台',
loginTitle: '调度一部', loginTitle: '调度一部',
homeTitle: '调度一部', homeTitle: '调度一部',
browserTitle: '西安地铁调度一部城市轨道交通设计平台', browserTitle: '西安地铁调度一部城市轨道交通设计平台',
loginPath: '/designxadt/login' loginPath: '/designxadt/login',
loginParam: 'DEFAULT'
}, },
jsxt:{ jsxt:{
title: '城市轨道交通竞赛平台', title: '城市轨道交通竞赛平台',
loginPath: '/jsxt/login' loginPath: '/jsxt/login',
loginParam: 'DEFAULT'
}, },
refereeJsxt:{ refereeJsxt:{
title: '城市轨道交通裁判平台', title: '城市轨道交通裁判平台',
loginPath: '/refereeJsxt/login' loginPath: '/refereeJsxt/login',
loginParam: 'DEFAULT'
}, },
jyd: { jyd: {
title: '城市轨道交通实训平台', title: '城市轨道交通实训平台',
@ -72,7 +84,8 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
loginTitle: 'jyd', loginTitle: 'jyd',
bottomColumn: '', bottomColumn: '',
bottomIcon: Bottom_Jyd, bottomIcon: Bottom_Jyd,
linkIcon: Link_Jyd linkIcon: Link_Jyd,
loginParam: 'DEFAULT'
}, },
designjyd: { designjyd: {
title: '城市轨道交通设计平台', title: '城市轨道交通设计平台',
@ -80,7 +93,8 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
loginPath: '/designjyd/login', loginPath: '/designjyd/login',
bottomColumn: '', bottomColumn: '',
bottomIcon: Bottom_Jyd, bottomIcon: Bottom_Jyd,
linkIcon: Link_Jyd linkIcon: Link_Jyd,
loginParam: 'DEFAULT'
} }
}; };

View File

@ -71,9 +71,10 @@ const user = {
const username = userInfo.username.trim(); const username = userInfo.username.trim();
const password = userInfo.password.trim(); const password = userInfo.password.trim();
const type = userInfo.type; const type = userInfo.type;
const project = userInfo.project;
return new Promise((resolve, reject) => { 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 => { login(params).then(resp => {
const token = resp.data; const token = resp.data;
const header = { group: '', 'X-Token': token }; const header = { group: '', 'X-Token': token };

View File

@ -206,12 +206,14 @@ export default {
if (valid) { if (valid) {
const model = Object.assign({}, this.loginForm); const model = Object.assign({}, this.loginForm);
model.password = md5(model.password); model.password = md5(model.password);
model.project = loginInfo[this.project].loginParam;
model.type = this.modelType; model.type = this.modelType;
this.loading = true; this.loading = true;
if (this.isAutoLogin) { if (this.isAutoLogin) {
Cookies.set(this.cookiesName, model.username, { expires: 2}); Cookies.set(this.cookiesName, model.username, { expires: 2});
Cookies.set(this.cookiesToken, model.password, { expires: 2}); Cookies.set(this.cookiesToken, model.password, { expires: 2});
} }
console.log(model, '111111111111');
this.$store.dispatch('Login', model).then(() => { this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();

View File

@ -187,7 +187,7 @@ export default {
document.querySelector("link[rel*='icon']").href = loginInfo[this.project].linkIcon || ProjectIcon[this.project]; document.querySelector("link[rel*='icon']").href = loginInfo[this.project].linkIcon || ProjectIcon[this.project];
this.computedAttribute(); this.computedAttribute();
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) { 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; model.type = this.modelType;
this.$store.dispatch('Login', model).then(() => { this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('SetAccount', model.username);
@ -245,7 +245,9 @@ export default {
}, },
loginRefresh() { loginRefresh() {
this.loadingCode = true; 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.sessionId = response.data.sessionId;
this.loginUrl = response.data.url; this.loginUrl = response.data.url;
this.loadingCode = false; this.loadingCode = false;
@ -255,8 +257,7 @@ export default {
this.loginUrl = ''; this.loginUrl = '';
}, 3 * 60 * 1000); }, 3 * 60 * 1000);
this.checkLoginStatus(); this.checkLoginStatus();
}).catch((error) => { }).catch(() => {
console.log(error);
this.loadingCode = false; this.loadingCode = false;
this.$messageBox(this.$t('login.getLoginQrCode')); this.$messageBox(this.$t('login.getLoginQrCode'));
}); });
@ -280,7 +281,7 @@ export default {
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
}); });
}).catch(error => { }).catch(error => {
if (error.data && error.data.status === '1') { if (error.data && error.data.status === 'WAIT') {
self.scanSuccess = true; self.scanSuccess = true;
} }
self.checkLoginStatus(); self.checkLoginStatus();

View File

@ -105,6 +105,7 @@ export default {
return lastData; return lastData;
}, },
covertData(memberVOList, element) { covertData(memberVOList, element) {
debugger;
const member = memberVOList.find(elem=>{ return elem.id == element.memberId; }); const member = memberVOList.find(elem=>{ return elem.id == element.memberId; });
const memberName = member.name; const memberName = member.name;
switch (element.type) { switch (element.type) {
@ -127,9 +128,10 @@ export default {
} }
case 'Command': case 'Command':
{ {
const command = CommandHandler.getScriptDefinition(element.operationType); // const command = CommandHandler.getScriptDefinition(element.operationType);
let operateType = command.operate.split('_')[0]; const commandName = element.operationType;
const data = command.operate.toUpperCase(); let operateType = commandName.split('_')[0];
const data = commandName.toUpperCase();
if (operateType == 'CM') { if (operateType == 'CM') {
operateType = 'ControlConvertMenu'; operateType = 'ControlConvertMenu';
} }