Browse Source

去掉debug

dev
jiangyy 5 years ago
parent
commit
b8637c96c5
  1. 75
      epmet-oper-web/src/views/pages/loginWork.vue

75
epmet-oper-web/src/views/pages/loginWork.vue

@ -1,5 +1,6 @@
<template> <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"> <div class="aui-content__wrapper">
<main class="aui-content"> <main class="aui-content">
@ -191,20 +192,20 @@ export default {
if (this.$route.query.platformToken) { if (this.$route.query.platformToken) {
this.isShowLogin = false; this.isShowLogin = false;
this.getAutoLogin(this.$route.query.platformToken) this.getAutoLogin(this.$route.query.platformToken)
}else{ } else {
this.getCaptcha() this.getCaptcha()
// //
this.getPubKey() this.getPubKey()
} }
}, },
mounted() { mounted () {
localStorage.removeItem('showHeader'); localStorage.removeItem('showHeader');
}, },
methods: { methods: {
// //
getPubKey() { getPubKey () {
this.$http.post('/auth/govweb/getKey').then(({data: res}) => { this.$http.post('/auth/govweb/getKey').then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) 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}` this.captchaPath = `${window.SITE_CONFIG['apiURL']}/auth/login/captcha?uuid=${this.dataForm.uuid}`
}, },
// //
dataFormSubmitHandle() { dataFormSubmitHandle () {
this.$refs['dataForm'].validate((valid, messageObj) => { this.$refs['dataForm'].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
app.util.validateRule(messageObj) app.util.validateRule(messageObj)
@ -231,35 +232,35 @@ export default {
phone: this.dataForm.phone phone: this.dataForm.phone
} }
window.app.ajax.post( window.app.ajax.post(
url, params, url, params,
(data, rspMsg) => { (data, rspMsg) => {
if (data.length === 0) {// if (data.length === 0) {//
this.$message.error('账号不存在') this.$message.error('账号不存在')
this.endLoading() this.endLoading()
} else if (data.length === 1) { } else if (data.length === 1) {
this.selectCustomer(data[0]) this.selectCustomer(data[0])
} else { } else {
this.endLoading() this.endLoading()
this.diaVisible = true this.diaVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.tableData = data this.tableData = data
}) })
} }
}, },
(rspMsg, data) => { (rspMsg, data) => {
this.endLoading() this.endLoading()
this.$message.error(rspMsg) this.$message.error(rspMsg)
}) })
}) })
}, },
// //
getAutoLogin(platformToken) { getAutoLogin (platformToken) {
this.dataForm.thirdToken = platformToken; this.dataForm.thirdToken = platformToken;
this.dataForm.platform = "pyld"; 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 !== 0) {
if (res.code == 8302) { if (res.code == 8302) {
return this.$message.error(res.internalMsg) return this.$message.error(res.internalMsg)
@ -270,13 +271,13 @@ export default {
localStorage.setItem('userType', 'work') localStorage.setItem('userType', 'work')
localStorage.setItem('showHeader', '0') localStorage.setItem('showHeader', '0')
Cookies.set('token', res.data.token) Cookies.set('token', res.data.token)
this.$router.replace({name: 'home'}) this.$router.replace({ name: 'home' })
}).catch(() => { }).catch(() => {
}) })
// epmet-ext9.elinkservice.cn/platform-admin // epmet-ext9.elinkservice.cn/platform-admin
}, },
// //
selectCustomer(row) { selectCustomer (row) {
localStorage.setItem('customerId', row.customerId) localStorage.setItem('customerId', row.customerId)
localStorage.setItem('customerName', row.customerName) localStorage.setItem('customerName', row.customerName)
this.startLoading() this.startLoading()
@ -284,9 +285,9 @@ export default {
const url = '/auth/govweb/login' const url = '/auth/govweb/login'
this.dataForm.customerId = row.customerId this.dataForm.customerId = row.customerId
let param = {}; let param = {};
Object.assign(param,this.dataForm); Object.assign(param, this.dataForm);
param.password = this.encryptedData(this.pubKey, this.dataForm.password); 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) { if (res.code !== 0) {
this.getCaptcha() this.getCaptcha()
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -296,19 +297,19 @@ export default {
localStorage.setItem('userType', 'work') localStorage.setItem('userType', 'work')
Cookies.set('token', res.data.token) Cookies.set('token', res.data.token)
this.$router.replace({name: 'home'}) this.$router.replace({ name: 'home' })
}).catch(() => { }).catch(() => {
}) })
this.endLoading() this.endLoading()
}, },
// //
diaCancel() { diaCancel () {
this.diaVisible = false this.diaVisible = false
}, },
// //
startLoading() { startLoading () {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: '正在加载……', //
@ -316,15 +317,15 @@ export default {
}) })
}, },
// //
endLoading() { endLoading () {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() loading.close()
} }
}, },
// //
encryptedData(key, data) { encryptedData (key, data) {
debugger
// JSEncrypt // JSEncrypt
let encryptor = new JSEncrypt(); let encryptor = new JSEncrypt();
// //

Loading…
Cancel
Save