项目登陆路径调整(变成 design/login?project=xxx)
This commit is contained in:
parent
92da104ad0
commit
c345a60997
@ -51,9 +51,9 @@ function getRouteInfo(to) {
|
||||
const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : '';
|
||||
loginPath = whitePage || loginPage;
|
||||
if (to.query.projectDevice && to.query.ibpDevice) {
|
||||
loginPath = `${loginPath}?projectDevice=${to.query.projectDevice}&ibpDevice=${to.query.ibpDevice}`;
|
||||
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&ibpDevice=${to.query.ibpDevice}`;
|
||||
} else if (to.query.projectDevice) {
|
||||
loginPath = `${loginPath}?projectDevice=${to.query.projectDevice}`;
|
||||
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}`;
|
||||
}
|
||||
if (current_session && current_session.startsWith('jsxt') || current_session && current_session.startsWith('refereeJsxt')) {
|
||||
const raceId = getSessionStorage('raceId'); // 登陆时候保存 竞赛id
|
||||
|
@ -6,7 +6,8 @@ Vue.use(VueRouter);
|
||||
|
||||
/* Layout */
|
||||
const Layout = () => import('@/layout');
|
||||
const Login = () => import('@/views/login/hydLogin');
|
||||
// const Login = () => import('@/views/login/hydLogin');
|
||||
const Login = () => import('@/views/login/index');
|
||||
|
||||
const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
|
||||
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
|
||||
|
@ -15,7 +15,8 @@ import { LoginParams } from '@/utils/login';
|
||||
export const loginInfo = {
|
||||
xty: {
|
||||
title: '西安铁路职业技术学院城市轨道交通实训平台',
|
||||
loginPath: '/xty/login',
|
||||
// loginPath: '/xty/login',
|
||||
loginPath:'/login?pro=xty',
|
||||
loginParam: 'XTY',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
@ -36,28 +37,33 @@ export const loginInfo = {
|
||||
},
|
||||
designxty: {
|
||||
title: '西安铁路职业技术学院城市轨道交通设计平台',
|
||||
loginPath: '/designxty/login',
|
||||
// loginPath: '/designxty/login',
|
||||
loginPath:'/design/login?project=xty',
|
||||
loginParam: 'XTY',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
gzb: {
|
||||
title: '贵州装备制造职业学院城市轨道交通实训平台',
|
||||
loginPath: '/gzb/login',
|
||||
// loginPath: '/gzb/login',
|
||||
loginPath:'/login?project=gzb',
|
||||
loginParam: 'GZB',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
designgzb: {
|
||||
title: '贵州装备制造职业学院城市轨道交通设计平台',
|
||||
loginPath: '/designgzb/login',
|
||||
// loginPath: '/designgzb/login',
|
||||
loginPath:'/design/login?project=gzb',
|
||||
loginParam: 'GZB',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
},
|
||||
hyd: {
|
||||
title: '城市轨道交通综合行车模拟仿真系统V1.0',
|
||||
loginPath: '/login',
|
||||
loginTitle: '城市轨道交通综合行车模拟仿真系统V1.0',
|
||||
logoWidth: '140px',
|
||||
loginPath: '/login?project=hyd',
|
||||
bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273',
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '120px',
|
||||
@ -65,7 +71,9 @@ export const loginInfo = {
|
||||
},
|
||||
designhyd: {
|
||||
title: '城市轨道交通设计平台V1.0',
|
||||
loginPath: '/design/login',
|
||||
loginTitle: '城市轨道交通设计平台V1.0',
|
||||
logoWidth: '140px',
|
||||
loginPath: '/design/login?project=hyd',
|
||||
bottomColumn: '哈尔滨盈达科技有限公司 联系电话:0451-87001273',
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '120px',
|
||||
@ -77,7 +85,8 @@ export const loginInfo = {
|
||||
loginTitle: '调度一部',
|
||||
homeTitle: '调度一部',
|
||||
browserTitle: '西安地铁调度一部城市轨道交通实训平台',
|
||||
loginPath: '/xadt/login',
|
||||
loginPath:'/login?project=xadt',
|
||||
// loginPath: '/xadt/login',
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
@ -88,7 +97,8 @@ export const loginInfo = {
|
||||
loginTitle: '调度一部',
|
||||
homeTitle: '调度一部',
|
||||
browserTitle: '西安地铁调度一部城市轨道交通设计平台',
|
||||
loginPath: '/designxadt/login',
|
||||
// loginPath: '/designxadt/login',
|
||||
loginPath:'/design/login?project=xadt',
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '40px',
|
||||
navigationMarginLeft: '60px'
|
||||
@ -109,7 +119,8 @@ export const loginInfo = {
|
||||
},
|
||||
jyd: {
|
||||
title: '城市轨道交通实训平台',
|
||||
loginPath: '/jyd/login',
|
||||
// loginPath: '/jyd/login',
|
||||
loginPath:'/login?project=jyd',
|
||||
logoWidth: '300px',
|
||||
navigationLogoWidth: '120px',
|
||||
navigationMarginLeft: '140px',
|
||||
@ -125,7 +136,8 @@ export const loginInfo = {
|
||||
logoWidth: '300px',
|
||||
navigationLogoWidth: '120px',
|
||||
navigationMarginLeft: '140px',
|
||||
loginPath: '/designjyd/login',
|
||||
// loginPath: '/designjyd/login',
|
||||
loginPath:'/design/login?project=jyd',
|
||||
bottomColumn: '',
|
||||
bottomIcon: Bottom_Jyd,
|
||||
linkIcon: Link_Jyd,
|
||||
@ -133,19 +145,25 @@ export const loginInfo = {
|
||||
},
|
||||
tky: {
|
||||
title: '城市轨道交通实训平台',
|
||||
loginPath: '/tky/login',
|
||||
loginTitle: 'jyd',
|
||||
// loginPath: '/tky/login',
|
||||
loginPath:'/login?project=tky',
|
||||
loginTitle: '空串',
|
||||
bottomColumn: '',
|
||||
bottomIcon: FaviconTky,
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '75px',
|
||||
navigationMarginLeft: '90px'
|
||||
},
|
||||
designtky: {
|
||||
title: '城市轨道交通设计平台',
|
||||
loginPath: '/designtky/login',
|
||||
loginTitle: 'jyd',
|
||||
// loginPath: '/designtky/login',
|
||||
loginPath:'/design/login?project=tky',
|
||||
loginTitle: '空串',
|
||||
bottomIcon: FaviconTky,
|
||||
bottomColumn: '',
|
||||
loginParam: 'DEFAULT'
|
||||
loginParam: 'DEFAULT',
|
||||
navigationLogoWidth: '75px',
|
||||
navigationMarginLeft: '90px'
|
||||
}
|
||||
};
|
||||
|
||||
@ -191,25 +209,33 @@ export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb',
|
||||
export const goOtherPlatformMenu = { // 导航栏快速切换平台
|
||||
login: '/design/login',
|
||||
design: '/login',
|
||||
xty: '/designxty/login',
|
||||
designxty: '/xty/login',
|
||||
gzb: '/designgzb/login',
|
||||
designgzb: '/gzb/login',
|
||||
hyd: '/design/login',
|
||||
designhyd: '/login',
|
||||
xadt: '/designxadt/login',
|
||||
designxadt: '/xadt/login',
|
||||
jyd: '/designjyd/login',
|
||||
designjyd: '/jyd/login',
|
||||
tky: '/designtky/login',
|
||||
designtky: '/tky/login'
|
||||
xty: '/design/login?project=xty',
|
||||
designxty: '/login?project=xty',
|
||||
gzb: '/design/login?project=gzb',
|
||||
designgzb: '/login?project=gzb',
|
||||
hyd: '/design/login?project=hyd',
|
||||
designhyd: '/login?project=hyd',
|
||||
xadt: '/design/login?project=xadt',
|
||||
designxadt: '/login?project=xadt',
|
||||
jyd: '/design/login?project=jyd',
|
||||
designjyd: '/login?project=jyd',
|
||||
tky: '/design/login?project=tky',
|
||||
designtky: '/login?project=tky'
|
||||
};
|
||||
export const PermissionParam = { // 路径权限处理所需参数配置(跳转白名单&路径正则匹配&clientId)
|
||||
hyd: {
|
||||
systemType: '011'
|
||||
// systemType: '011'
|
||||
whitePage: '/login?project=hyd',
|
||||
reg: /^\/hyd/,
|
||||
systemType: '011',
|
||||
clientId: null
|
||||
},
|
||||
designhyd: {
|
||||
systemType: '011'
|
||||
// systemType: '011'
|
||||
whitePage: '/design/login?project=hyd',
|
||||
reg: /^\/designhyd/,
|
||||
systemType: '011',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
login: {
|
||||
systemType: '011'
|
||||
@ -218,61 +244,61 @@ export const PermissionParam = { // 路径权限处理所需参数配置(跳
|
||||
systemType: '011'
|
||||
},
|
||||
designxty: {
|
||||
whitePage: '/designxty/login',
|
||||
whitePage: '/design/login?project=xty',
|
||||
reg: /^\/designxty/,
|
||||
systemType: '013',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designgzb: {
|
||||
whitePage: '/designgzb/login',
|
||||
whitePage: '/design/login?project=gzb',
|
||||
reg: /^\/designgzb/,
|
||||
systemType: '014',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designxadt: {
|
||||
whitePage: '/designxadt/login',
|
||||
whitePage: '/design/login?project=xadt',
|
||||
reg: /^\/designxadt/,
|
||||
systemType: '012',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designjyd: {
|
||||
whitePage: '/designjyd/login',
|
||||
whitePage: '/design/login?project=jyd',
|
||||
reg: /^\/designjyd/,
|
||||
systemType: '017',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
designtky: {
|
||||
whitePage: '/designtky/login',
|
||||
whitePage: '/design/login?project=tky',
|
||||
reg: /^\/designtky/,
|
||||
systemType: '018',
|
||||
clientId: LoginParams.Design.clientId
|
||||
},
|
||||
xty: {
|
||||
whitePage: '/xty/login',
|
||||
whitePage: '/login?project=xty',
|
||||
reg: /^\/xty/,
|
||||
systemType: '013',
|
||||
clientId: null
|
||||
},
|
||||
gzb: {
|
||||
whitePage: '/gzb/login',
|
||||
whitePage: '/login?project=gzb',
|
||||
reg: /^\/gzb/,
|
||||
systemType: '014',
|
||||
clientId: null
|
||||
},
|
||||
xadt: {
|
||||
whitePage: '/xadt/login',
|
||||
whitePage: '/login?project=xadt',
|
||||
reg: /^\/xadt/,
|
||||
systemType: '012',
|
||||
clientId: null
|
||||
},
|
||||
jyd: {
|
||||
whitePage: '/jyd/login',
|
||||
whitePage: '/login?project=jyd',
|
||||
reg: /^\/jyd/,
|
||||
systemType: '017',
|
||||
clientId: null
|
||||
},
|
||||
tky: {
|
||||
whitePage: '/tky/login',
|
||||
whitePage: '/login?project=tky',
|
||||
reg: /^\/tky/,
|
||||
systemType: '018',
|
||||
clientId: null
|
||||
|
@ -1,499 +0,0 @@
|
||||
<template>
|
||||
<div
|
||||
v-loading="ibpDevice && !loadingCode"
|
||||
class="login-container"
|
||||
:style="{'background-image': 'url('+bgImg+')'}"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-text="检测主工作站登录中"
|
||||
element-loading-background="rgba(0, 0, 0, 0)"
|
||||
>
|
||||
<el-button v-if="ibpDevice && loadingCode" type="text" style="font-size: 24px;font-weight: bold;" @click="loginRefresh">主工作站未登录,点击重新检测</el-button>
|
||||
<div v-if="!ibpDevice" class="text-box">
|
||||
<img class="logo" :src="logoImg" style="width: 140px">
|
||||
<span>{{ title }}</span>
|
||||
</div>
|
||||
<div v-if="!ibpDevice" class="language_box">
|
||||
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
|
||||
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="!ibpDevice" class="content-box">
|
||||
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
|
||||
<el-form-item prop="username" class="item_form_box">
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
</span>
|
||||
<el-input v-model="loginForm.username" name="username" type="text" :placeholder="this.$t('login.accountName')" @keyup.enter.native="goToNext" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="password" class="item_form_box item_form_password">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="password" />
|
||||
</span>
|
||||
<el-input
|
||||
ref="password"
|
||||
v-model="loginForm.password"
|
||||
name="password"
|
||||
:type="pwdType"
|
||||
:placeholder="this.$t('login.password')"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon v-if="pwdDisplay" icon-class="eye" />
|
||||
<svg-icon v-else icon-class="eye-open" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
<div class="tip-message">{{ tipsMsg }}</div>
|
||||
<div style="display: inline-block;width: 100%;margin-bottom: 10px;">
|
||||
<div style="display:inline-block">
|
||||
<el-checkbox v-model="isAutoLogin">{{ $t('login.autoLogin') }}</el-checkbox>
|
||||
</div>
|
||||
<el-popover
|
||||
placement="right"
|
||||
title=""
|
||||
width="200"
|
||||
trigger="hover"
|
||||
class="popover_box"
|
||||
>
|
||||
<div>
|
||||
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
|
||||
<div style="margin-top: 10px; word-break: break-word;text-align: center;">{{ $t('login.perfectInformation') }}</div>
|
||||
</div>
|
||||
<!--<div slot="reference">{{ $t('login.unableToLogin') }}</div>-->
|
||||
</el-popover>
|
||||
</div>
|
||||
<el-form-item>
|
||||
<el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin">
|
||||
{{ $t('login.login') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QCode from '@/assets/erCode.jpg';
|
||||
import { setSessionStorage, removeSessionStorage, getLoginInfo } from '@/utils/auth';
|
||||
import Cookies from 'js-cookie';
|
||||
import bgIbpImg from '@/assets/bg_ibp.png';
|
||||
import md5 from 'js-md5';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { loginInfo, ProjectIcon, LoginParams } from '@/scripts/ProjectConfig';
|
||||
import { removeToken } from '@/utils/auth';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import logoImgHyd from '@/assets/project_icon/logo_hyd.png';
|
||||
import { getSimulationInfoNew } from '@/api/simulation';
|
||||
import { getLoginWmurl, checkLoginStatus, getLoginInfo } from '@/api/login';
|
||||
import { getToken } from '@/utils/auth';
|
||||
export default {
|
||||
name: 'Login',
|
||||
data() {
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
callback(new Error(this.$t('login.enterTheCorrectUserName')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const validatePass = (rule, value, callback) => {
|
||||
if (value.length < 5) {
|
||||
callback(new Error(this.$t('login.passwordHint')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
QCode: QCode,
|
||||
isAutoLogin: false,
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
||||
password: [{ required: true, trigger: 'blur', validator: validatePass }]
|
||||
},
|
||||
loading: false,
|
||||
pwdType: 'password',
|
||||
tipsMsg: '',
|
||||
qrcodeClassName: 'login-qrcode',
|
||||
sessionId: '',
|
||||
loginUrl: '',
|
||||
loadingCode: false,
|
||||
checkLogin: null,
|
||||
checkTimeout: null,
|
||||
scanSuccess: false,
|
||||
pwdDisplay: true,
|
||||
cookiesName: 'UserName',
|
||||
cookiesToken: 'UserToken',
|
||||
modelType: 'class',
|
||||
loginClient: 'LianKeTang',
|
||||
path: '/trainingPlatform',
|
||||
lang: 'zh',
|
||||
language: '中文',
|
||||
logoImg: logoImgHyd,
|
||||
title: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
project() {
|
||||
return this.$route.path.split('/')[1];
|
||||
},
|
||||
bgImg() {
|
||||
return this.$route.query.ibpDevice ? bgIbpImg : '';
|
||||
},
|
||||
ibpDevice() {
|
||||
return this.$route.query.ibpDevice;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
document.querySelector("link[rel*='icon']").href = ProjectIcon['hyd'];
|
||||
this.computedAttribute();
|
||||
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
|
||||
const model = {'username': Cookies.get(this.cookiesName), 'password': Cookies.get(this.cookiesToken)};
|
||||
model.type = this.modelType;
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
if (error.code === '30001') {
|
||||
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||
} else if (error.code == '10001') {
|
||||
this.tipsMsg = '教研机尚未登录,请稍后重试!';
|
||||
} else {
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.project.startsWith('design')) {
|
||||
this.title = loginInfo['designhyd'].title;
|
||||
} else {
|
||||
this.title = loginInfo['hyd'].title;
|
||||
}
|
||||
if (this.ibpDevice) {
|
||||
this.loginRefresh();
|
||||
}
|
||||
document.title = this.title;
|
||||
},
|
||||
methods: {
|
||||
computedAttribute() {
|
||||
let sessionVal = 'hyd';
|
||||
if (this.project.startsWith('design')) {
|
||||
this.cookiesName = 'UserDesignName';
|
||||
this.cookiesToken = 'UserDesignToken';
|
||||
this.modelType = 'design';
|
||||
this.loginClient = 'Design';
|
||||
this.path = UrlConfig.design.prefix;
|
||||
sessionVal = 'designhyd';
|
||||
}
|
||||
const nowLang = LangStorage.getLang('zh');
|
||||
if (nowLang === 'zh') {
|
||||
this.lang = 'en';
|
||||
this.language = 'English';
|
||||
}
|
||||
|
||||
removeToken();
|
||||
|
||||
setSessionStorage('project', sessionVal);
|
||||
},
|
||||
clearTimer(timer) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
},
|
||||
loginRefresh() {
|
||||
this.loadingCode = true;
|
||||
const params = LoginParams[this.loginClient];
|
||||
params.project = loginInfo[this.project].loginParam;
|
||||
if (this.$route.query.projectDevice) {
|
||||
params.deviceCode = this.$route.query.projectDevice;
|
||||
}
|
||||
getLoginWmurl(params).then(response => {
|
||||
this.sessionId = response.data.sessionId;
|
||||
this.loginUrl = response.data.url;
|
||||
this.loadingCode = false;
|
||||
this.checkLoginStatus();
|
||||
}).catch(() => {
|
||||
this.loadingCode = false;
|
||||
this.$messageBox(this.$t('login.getLoginQrCode'));
|
||||
});
|
||||
},
|
||||
checkLoginStatus() {
|
||||
const self = this;
|
||||
// 销毁则不再定时
|
||||
if (this && this._isDestroyed) {
|
||||
return;
|
||||
}
|
||||
// 清空已存在的定时器
|
||||
// 设置定时器检测
|
||||
this.clearTimer(this.checkLogin);
|
||||
this.checkLogin = setTimeout(() => {
|
||||
checkLoginStatus(self.sessionId).then(response => {
|
||||
// 设置扫码登录
|
||||
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: this.modelType }).then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
this.handleLoginSucessRoute();
|
||||
});
|
||||
}).catch(error => {
|
||||
if (error.data && error.data.status === 'EXPIRE') {
|
||||
this.loadingCode = true;
|
||||
this.loginUrl = '';
|
||||
} else {
|
||||
self.checkLoginStatus();
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
},
|
||||
showPwd() {
|
||||
if (this.pwdType === 'password') {
|
||||
this.pwdDisplay = false;
|
||||
this.pwdType = '';
|
||||
} else {
|
||||
this.pwdType = 'password';
|
||||
this.pwdDisplay = true;
|
||||
}
|
||||
},
|
||||
goToNext() {
|
||||
if (this.loginForm.username.length < 5) {
|
||||
return;
|
||||
} else {
|
||||
this.$refs['password'].focus();
|
||||
}
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
model.project = loginInfo[this.project].loginParam;
|
||||
model.deviceCode = this.$route.query.projectDevice;
|
||||
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});
|
||||
}
|
||||
this.$store.dispatch('Login', model).then(() => {
|
||||
this.$store.dispatch('SetAccount', model.username);
|
||||
this.handleLoginSucessRoute();
|
||||
}).catch(error => {
|
||||
if (error.code === '30001') {
|
||||
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
|
||||
} else if (error.code == '10001') {
|
||||
this.tipsMsg = '教研机尚未登录,请稍后重试!';
|
||||
} else {
|
||||
this.tipsMsg = error.message;
|
||||
}
|
||||
this.loading = false;
|
||||
setTimeout(() => { this.tipsMsg = ''; }, 5000);
|
||||
});
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLoginSucessRoute() {
|
||||
// 设置路由
|
||||
this.loading = false;
|
||||
this.tipsMsg = '';
|
||||
removeSessionStorage('againEnter');
|
||||
if (this.$route.query.projectDevice) {
|
||||
getLoginInfo(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, projectDevice: this.$route.query.projectDevice };
|
||||
if (this.$route.query.ibpDevice) {
|
||||
query.ibpDevice = true;
|
||||
}
|
||||
this.$router.push({ path: `/jointTrainingNew`, query: query });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.$router.push({ path: this.path });
|
||||
},
|
||||
handleLanguage() {
|
||||
this.$i18n.locale = this.lang;
|
||||
LangStorage.setLang(this.lang);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
$bg:#fff;
|
||||
$light_gray:#eee;
|
||||
|
||||
.login-container {
|
||||
background: #E4EAEA;
|
||||
.el-form-item{
|
||||
background: #fff !important;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||
.el-input {
|
||||
height: 40px;
|
||||
width: 85%;
|
||||
background: #fff;
|
||||
input {
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 0px;
|
||||
padding: 8px 9px 7px 5px;
|
||||
color: #000;
|
||||
height: 100%;
|
||||
|
||||
&:-webkit-autofill {
|
||||
box-shadow: 0 0 0px 1000px $bg inset !important;
|
||||
-webkit-text-fill-color: #000 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item_form_box {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
color: #454545;
|
||||
}
|
||||
|
||||
.item_form_password{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tip-message {
|
||||
color: #F56C61;
|
||||
padding: 5px;
|
||||
font-size: 12px;
|
||||
height: 23px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
$bg:#f0f0f0;
|
||||
$qrbg:#fff;
|
||||
$dark_gray:#889aa4;
|
||||
$light_gray:#eee;
|
||||
$qrcodeSize: 270px;
|
||||
.popover_box {
|
||||
position: absolute;
|
||||
right: 80px;
|
||||
bottom: 106px;
|
||||
cursor: pointer;
|
||||
color: #225592;
|
||||
font-size: 14px;
|
||||
}
|
||||
.login-container {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-origin: border-box;
|
||||
background-size: 100% 100%;
|
||||
.content-box{
|
||||
width: 450px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
padding: 30px 30px 30px;
|
||||
margin-bottom: 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
.text-box{
|
||||
position: absolute;
|
||||
top: 10%;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.logo{
|
||||
vertical-align: middle;
|
||||
}
|
||||
.language_box{
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 40px;
|
||||
.language_btn{
|
||||
/*font-weight: bold;*/
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
.login-form {
|
||||
width: 440px;
|
||||
padding: 0 50px;
|
||||
}
|
||||
|
||||
.svg-container {
|
||||
padding-left: 14px;
|
||||
color: $dark_gray;
|
||||
vertical-align: middle;
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
|
||||
&_login {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.title_box {
|
||||
font-size: 20px;
|
||||
color: #000;
|
||||
margin: 0px auto 30px auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.show-pwd {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 3px;
|
||||
font-size: 16px;
|
||||
color: $dark_gray;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
||||
.qrcode-main{
|
||||
width: 300px;
|
||||
background-color: $qrbg;
|
||||
text-align: center;
|
||||
border-right: 1px solid #ececec;
|
||||
.tip-info {
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
color: green;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.login-code-box{
|
||||
width: 150px;
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.system-type {
|
||||
margin: 5px 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sub-title {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #353535;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -8,7 +8,7 @@
|
||||
element-loading-background="rgba(0, 0, 0, 0)"
|
||||
>
|
||||
<el-button v-if="ibpDevice && loadingCode" type="text" style="font-size: 24px;font-weight: bold;" @click="loginRefresh">主工作站未登录,点击重新检测</el-button>
|
||||
<div v-if="loginTitle && !ibpDevice" class="left-logo-box">
|
||||
<div v-if="loginTitle && !ibpDevice" :class="$route.query.project=='hyd'?'text-box':'left-logo-box'">
|
||||
<img class="logo" :src="logoImg" :style="{width: logoWidth}">
|
||||
<span>{{ loginTitle==='空串'?'':loginTitle }}</span>
|
||||
</div>
|
||||
@ -21,8 +21,8 @@
|
||||
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div v-if="!ibpDevice" class="content-box">
|
||||
<div class="qrcode-main">
|
||||
<div v-if="!ibpDevice" class="content-box" :style="$route.query.project=='hyd'?'width: 450px;':''">
|
||||
<div v-if="$route.query.project!='hyd'" class="qrcode-main">
|
||||
<div class="login-code-box" @click="loginRefresh">
|
||||
<qrcode-vue
|
||||
v-loading="loadingCode"
|
||||
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<el-form ref="loginForm" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
|
||||
<div v-if="!isProject" class="title_box">{{ $t('login.welcomeTo') + title }}</div>
|
||||
<div v-if="!isProject&&$route.query.project!='hyd'" class="title_box">{{ $t('login.welcomeTo') + title }}</div>
|
||||
<el-form-item prop="username" class="item_form_box">
|
||||
<span class="svg-container svg-container_login">
|
||||
<svg-icon icon-class="user" />
|
||||
@ -180,27 +180,37 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
project() {
|
||||
return this.$route.path.split('/')[1];
|
||||
const project = this.$route.query.project;
|
||||
const split = this.$route.path.split('/')[1];
|
||||
if (split == 'design') {
|
||||
return project ? split + project : split;
|
||||
} else if (split == 'login') {
|
||||
return project || 'login';
|
||||
} else {
|
||||
return split;
|
||||
}
|
||||
},
|
||||
loginTitle () {
|
||||
return loginInfo[this.$route.path.split('/')[1]].loginTitle;
|
||||
// this.$route.path.split('/')[1]
|
||||
return loginInfo[this.project].loginTitle;
|
||||
},
|
||||
title() {
|
||||
return loginInfo[this.$route.path.split('/')[1]].title;
|
||||
return loginInfo[this.project].title;
|
||||
},
|
||||
logoWidth() {
|
||||
return loginInfo[this.$route.path.split('/')[1]].logoWidth;
|
||||
return loginInfo[this.project].logoWidth;
|
||||
},
|
||||
isProject() {
|
||||
const projectName = this.$route.path.split('/')[1];
|
||||
const projectName = this.project;
|
||||
return GenerateRouteProjectList.includes(projectName);
|
||||
},
|
||||
logoImg() {
|
||||
const projectName = this.$route.path.split('/')[1];
|
||||
const projectName = this.project;
|
||||
return ProjectIcon[projectName];
|
||||
},
|
||||
bgImg() {
|
||||
return this.$route.query.ibpDevice ? bgIbpImg : bgImg;
|
||||
const bgImgAll = this.$route.query.project == 'hyd' ? '' : bgImg;
|
||||
return this.$route.query.ibpDevice ? bgIbpImg : bgImgAll;
|
||||
},
|
||||
ibpDevice() {
|
||||
return this.$route.query.ibpDevice;
|
||||
@ -230,7 +240,9 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
document.title = loginInfo[this.project].browserTitle || loginInfo[this.project].title;
|
||||
this.loginRefresh();
|
||||
if (this.ibpDevice || this.$route.query.project != 'hyd') {
|
||||
this.loginRefresh();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
computedAttribute() {
|
||||
@ -331,6 +343,7 @@ export default {
|
||||
const model = Object.assign({}, this.loginForm);
|
||||
model.password = md5(model.password);
|
||||
model.type = this.modelType;
|
||||
model.project = loginInfo[this.project].loginParam;
|
||||
model.deviceCode = this.$route.query.projectDevice;
|
||||
this.loading = true;
|
||||
if (this.isAutoLogin) {
|
||||
|
@ -39,10 +39,11 @@ export default {
|
||||
{label: '行调工作站', value: 'CW'},
|
||||
{label: '综合监控', value: 'ISCS'}
|
||||
],
|
||||
projectList: [{label:'西铁院', value: 'XTY'}, {label: '贵州装备', value:'GZB'}],
|
||||
projectList: [{label:'西铁院', value: 'XTY'}, {label: '贵州装备', value:'GZB'}, {label: '盈达科技', value:'HYD'}],
|
||||
projectMap: {
|
||||
designxty: 'XTY',
|
||||
designgzb: 'GZB'
|
||||
designgzb: 'GZB',
|
||||
designhyd: 'HYD'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
@ -199,9 +200,9 @@ export default {
|
||||
getPath(index, row) {
|
||||
let url = '';
|
||||
if (row.type === 'IBP') {
|
||||
url = `${window.location.protocol}//${window.location.host}/${this.projectCode.toLowerCase()}/login?projectDevice=${row.code}&ibpDevice=true`;
|
||||
url = `${window.location.protocol}//${window.location.host}/login?project=${this.projectCode.toLowerCase()}&projectDevice=${row.code}&ibpDevice=true`;
|
||||
} else {
|
||||
url = `${window.location.protocol}//${window.location.host}/${this.projectCode.toLowerCase()}/login?projectDevice=${row.code}`;
|
||||
url = `${window.location.protocol}//${window.location.host}/login?project=${this.projectCode.toLowerCase()}&projectDevice=${row.code}`;
|
||||
}
|
||||
this.url = url;
|
||||
this.$messageBox();
|
||||
|
Loading…
Reference in New Issue
Block a user