|
|
|
@ -1,57 +1,57 @@ |
|
|
|
<template> |
|
|
|
<div class="g-app"> |
|
|
|
<div class="g-bd" v-if="isShowLogin || true"> |
|
|
|
<div class="g-bd" |
|
|
|
v-if="isShowLogin || true"> |
|
|
|
<div class="m-fm"> |
|
|
|
<div class="wrap"> |
|
|
|
<h2 class="title">{{ $t("brand.work") }}</h2> |
|
|
|
<div class="fm"> |
|
|
|
<el-form |
|
|
|
:model="dataForm" |
|
|
|
:rules="dataRule" |
|
|
|
ref="dataForm" |
|
|
|
@keyup.enter.native="dataFormSubmitHandle()" |
|
|
|
status-icon |
|
|
|
> |
|
|
|
<el-form :model="dataForm" |
|
|
|
:rules="dataRule" |
|
|
|
ref="dataForm" |
|
|
|
@keyup.enter.native="dataFormSubmitHandle()" |
|
|
|
status-icon> |
|
|
|
<div class="fm-item"> |
|
|
|
<div class="ico"> |
|
|
|
<img src="@/assets/img/login/zhanghao.png" alt="" /> |
|
|
|
<img src="@/assets/img/login/zhanghao.png" |
|
|
|
alt="" /> |
|
|
|
</div> |
|
|
|
<el-form-item prop="phone" class="input"> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
v-model="dataForm.phone" |
|
|
|
placeholder="账号" |
|
|
|
/> |
|
|
|
<el-form-item prop="phone" |
|
|
|
class="input"> |
|
|
|
<input type="text" |
|
|
|
v-model="dataForm.phone" |
|
|
|
placeholder="账号" /> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<div class="fm-item"> |
|
|
|
<div class="ico"> |
|
|
|
<img src="@/assets/img/login/mima.png" alt="" /> |
|
|
|
<img src="@/assets/img/login/mima.png" |
|
|
|
alt="" /> |
|
|
|
</div> |
|
|
|
<el-form-item prop="password" class="input"> |
|
|
|
<input |
|
|
|
type="password" |
|
|
|
v-model="dataForm.password" |
|
|
|
:placeholder="$t('login.password')" |
|
|
|
/> |
|
|
|
<el-form-item prop="password" |
|
|
|
class="input"> |
|
|
|
<input type="password" |
|
|
|
v-model="dataForm.password" |
|
|
|
:placeholder="$t('login.password')" /> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<div class="fm-captcha"> |
|
|
|
<div class="fm-item"> |
|
|
|
<el-form-item prop="captcha" class="input"> |
|
|
|
<input |
|
|
|
type="text" |
|
|
|
v-model="dataForm.captcha" |
|
|
|
placeholder="验证码" |
|
|
|
/> |
|
|
|
<el-form-item prop="captcha" |
|
|
|
class="input"> |
|
|
|
<input type="text" |
|
|
|
v-model="dataForm.captcha" |
|
|
|
placeholder="验证码" /> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<div class="captcha"> |
|
|
|
<img :src="captchaPath" @click="getCaptcha()" /> |
|
|
|
<img :src="captchaPath" |
|
|
|
@click="getCaptcha()" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="fm-btn" @click="dataFormSubmitHandle()"> |
|
|
|
<div class="fm-btn" |
|
|
|
@click="dataFormSubmitHandle()"> |
|
|
|
{{ $t("login.title") }} |
|
|
|
</div> |
|
|
|
<div class="hint">请使用小程序端的账号密码登录</div> |
|
|
|
@ -63,25 +63,27 @@ |
|
|
|
<div class="m-footer"> |
|
|
|
<div class="login-footer"> |
|
|
|
<p> |
|
|
|
<a href="" target="_blank">{{ $t("login.copyright") }}</a> |
|
|
|
<a href="" |
|
|
|
target="_blank">{{ $t("login.copyright") }}</a> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<c-dialog |
|
|
|
:showFooter="false" |
|
|
|
:title="'选择客户'" |
|
|
|
:isNest="false" |
|
|
|
:visible="diaVisible" |
|
|
|
:dialogHeight="0.8" |
|
|
|
:width="30" |
|
|
|
:top="'120px'" |
|
|
|
@cancel="diaCancel" |
|
|
|
> |
|
|
|
<c-dialog :showFooter="false" |
|
|
|
:title="'选择客户'" |
|
|
|
:isNest="false" |
|
|
|
:visible="diaVisible" |
|
|
|
:dialogHeight="0.8" |
|
|
|
:width="30" |
|
|
|
:top="'120px'" |
|
|
|
@cancel="diaCancel"> |
|
|
|
<div class="m-pop"> |
|
|
|
<div v-for="(item, index) in tableData" :key="index" class="div_row"> |
|
|
|
<span @click="selectCustomer(item)" class="span_name">{{ |
|
|
|
<div v-for="(item, index) in tableData" |
|
|
|
:key="index" |
|
|
|
class="div_row"> |
|
|
|
<span @click="selectCustomer(item)" |
|
|
|
class="span_name">{{ |
|
|
|
item.customerName |
|
|
|
}}</span> |
|
|
|
</div> |
|
|
|
@ -100,7 +102,7 @@ import { Loading } from "element-ui"; // 引入Loading服务 |
|
|
|
|
|
|
|
let loading; // 加载动画 |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
pubKey: null, // 获取到公钥 |
|
|
|
isShowLogin: true, |
|
|
|
@ -126,7 +128,7 @@ export default { |
|
|
|
CDialog, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
dataRule() { |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
phone: [{ required: true, message: "手机号不能为空", trigger: "blur" }], |
|
|
|
password: [ |
|
|
|
@ -138,7 +140,7 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created () { |
|
|
|
//平阴联动平台 登陆 |
|
|
|
if (this.$route.query.platformToken) { |
|
|
|
this.isShowLogin = false; |
|
|
|
@ -149,13 +151,13 @@ export default { |
|
|
|
this.getPubKey(); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
localStorage.removeItem("showHeader"); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// 登陆后跳转逻辑 |
|
|
|
skipAfterLogin() { |
|
|
|
skipAfterLogin () { |
|
|
|
let href = localStorage.getItem("thePageAtExit"); |
|
|
|
if (href && href.indexOf("login") == -1) { |
|
|
|
localStorage.removeItem("thePageAtExit"); |
|
|
|
@ -166,7 +168,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取公钥 |
|
|
|
getPubKey() { |
|
|
|
getPubKey () { |
|
|
|
this.$http |
|
|
|
.post("/auth/govweb/getKey") |
|
|
|
.then(({ data: res }) => { |
|
|
|
@ -176,15 +178,15 @@ export default { |
|
|
|
|
|
|
|
this.pubKey = res.data; // 获取到公钥; |
|
|
|
}) |
|
|
|
.catch(() => {}); |
|
|
|
.catch(() => { }); |
|
|
|
}, |
|
|
|
// 获取验证码 |
|
|
|
getCaptcha() { |
|
|
|
getCaptcha () { |
|
|
|
this.dataForm.uuid = getUUID(); |
|
|
|
this.captchaPath = `${window.SITE_CONFIG["apiURL"]}/auth/login/captcha?uuid=${this.dataForm.uuid}`; |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle() { |
|
|
|
dataFormSubmitHandle () { |
|
|
|
this.$refs["dataForm"].validate((valid, messageObj) => { |
|
|
|
console.log(valid, messageObj); |
|
|
|
if (!valid) { |
|
|
|
@ -222,7 +224,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 平阴联动 自动登录接口 |
|
|
|
getAutoLogin(platformToken) { |
|
|
|
getAutoLogin (platformToken) { |
|
|
|
this.dataForm.thirdToken = platformToken; |
|
|
|
this.dataForm.platform = "pyld"; |
|
|
|
this.$http |
|
|
|
@ -240,11 +242,11 @@ export default { |
|
|
|
localStorage.setItem("token", res.data.token); |
|
|
|
this.$router.replace({ name: "index" }); |
|
|
|
}) |
|
|
|
.catch(() => {}); |
|
|
|
.catch(() => { }); |
|
|
|
// epmet-ext9.elinkservice.cn/platform-admin |
|
|
|
}, |
|
|
|
//选择客户 |
|
|
|
selectCustomer(row) { |
|
|
|
selectCustomer (row) { |
|
|
|
localStorage.setItem("customerId", row.customerId); |
|
|
|
localStorage.setItem("customerName", row.customerName); |
|
|
|
this.startLoading(); |
|
|
|
@ -275,11 +277,11 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 取消 |
|
|
|
diaCancel() { |
|
|
|
diaCancel () { |
|
|
|
this.diaVisible = false; |
|
|
|
}, |
|
|
|
// 开启加载动画 |
|
|
|
startLoading() { |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: "正在加载……", // 加载中需要显示的文字 |
|
|
|
@ -287,7 +289,7 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading() { |
|
|
|
endLoading () { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close(); |
|
|
|
|