|
|
@ -1,5 +1,6 @@ |
|
|
|
<template> |
|
|
|
<div v-if="isShowLogin" class="aui-wrapper aui-page__login"> |
|
|
|
<div v-if="isShowLogin" |
|
|
|
class="aui-wrapper aui-page__login"> |
|
|
|
|
|
|
|
<div class="aui-content__wrapper"> |
|
|
|
<main class="aui-content"> |
|
|
@ -191,20 +192,20 @@ export default { |
|
|
|
if (this.$route.query.platformToken) { |
|
|
|
this.isShowLogin = false; |
|
|
|
this.getAutoLogin(this.$route.query.platformToken) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.getCaptcha() |
|
|
|
//获取公钥 |
|
|
|
this.getPubKey() |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
localStorage.removeItem('showHeader'); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// 获取公钥 |
|
|
|
getPubKey() { |
|
|
|
this.$http.post('/auth/govweb/getKey').then(({data: res}) => { |
|
|
|
getPubKey () { |
|
|
|
this.$http.post('/auth/govweb/getKey').then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
@ -219,7 +220,7 @@ export default { |
|
|
|
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}` |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle() { |
|
|
|
dataFormSubmitHandle () { |
|
|
|
this.$refs['dataForm'].validate((valid, messageObj) => { |
|
|
|
if (!valid) { |
|
|
|
app.util.validateRule(messageObj) |
|
|
@ -256,10 +257,10 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 平阴联动 自动登录接口 |
|
|
|
getAutoLogin(platformToken) { |
|
|
|
getAutoLogin (platformToken) { |
|
|
|
this.dataForm.thirdToken = platformToken; |
|
|
|
this.dataForm.platform = "pyld"; |
|
|
|
this.$http.post(`/auth/sso/oper/third/login`, this.dataForm).then(({data: res}) => { |
|
|
|
this.$http.post(`/auth/sso/oper/third/login`, this.dataForm).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
if (res.code == 8302) { |
|
|
|
return this.$message.error(res.internalMsg) |
|
|
@ -270,13 +271,13 @@ export default { |
|
|
|
localStorage.setItem('userType', 'work') |
|
|
|
localStorage.setItem('showHeader', '0') |
|
|
|
Cookies.set('token', res.data.token) |
|
|
|
this.$router.replace({name: 'home'}) |
|
|
|
this.$router.replace({ name: 'home' }) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
// epmet-ext9.elinkservice.cn/platform-admin |
|
|
|
}, |
|
|
|
//选择客户 |
|
|
|
selectCustomer(row) { |
|
|
|
selectCustomer (row) { |
|
|
|
localStorage.setItem('customerId', row.customerId) |
|
|
|
localStorage.setItem('customerName', row.customerName) |
|
|
|
this.startLoading() |
|
|
@ -284,9 +285,9 @@ export default { |
|
|
|
const url = '/auth/govweb/login' |
|
|
|
this.dataForm.customerId = row.customerId |
|
|
|
let param = {}; |
|
|
|
Object.assign(param,this.dataForm); |
|
|
|
Object.assign(param, this.dataForm); |
|
|
|
param.password = this.encryptedData(this.pubKey, this.dataForm.password); |
|
|
|
this.$http.post(url, param).then(({data: res}) => { |
|
|
|
this.$http.post(url, param).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
this.getCaptcha() |
|
|
|
return this.$message.error(res.msg) |
|
|
@ -296,19 +297,19 @@ export default { |
|
|
|
localStorage.setItem('userType', 'work') |
|
|
|
|
|
|
|
Cookies.set('token', res.data.token) |
|
|
|
this.$router.replace({name: 'home'}) |
|
|
|
this.$router.replace({ name: 'home' }) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
this.endLoading() |
|
|
|
|
|
|
|
}, |
|
|
|
// 取消 |
|
|
|
diaCancel() { |
|
|
|
diaCancel () { |
|
|
|
|
|
|
|
this.diaVisible = false |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading() { |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: '正在加载……', // 加载中需要显示的文字 |
|
|
@ -316,15 +317,15 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading() { |
|
|
|
endLoading () { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
}, |
|
|
|
// 加密 |
|
|
|
encryptedData(key, data) { |
|
|
|
debugger |
|
|
|
encryptedData (key, data) { |
|
|
|
|
|
|
|
// 新建JSEncrypt对象 |
|
|
|
let encryptor = new JSEncrypt(); |
|
|
|
// 设置公钥 |
|
|
|