|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
|
|
|
|
<div v-if="!isRestPwd"> |
|
|
|
<div class="login_form"> |
|
|
|
<el-form autoComplete="on" :model="loginForm" :rules="loginRules" ref="loginForm"> |
|
|
|
@ -36,8 +37,10 @@ |
|
|
|
<div class="bottom"> |
|
|
|
<el-divider content-position="center">第三方登录方式</el-divider> |
|
|
|
<div class="other"> |
|
|
|
<img src="@/assets/image/module/weixin.png"> |
|
|
|
<img src="@/assets/image/module/qq.png"> |
|
|
|
<el-popover trigger="manual" v-model="wxLoginCodeVisible" placement="top-start"> <div id="login_container"></div> |
|
|
|
<img slot="reference" src="@/assets/image/module/weixin.png" @click="weixinLogin"> |
|
|
|
<el-button type="text" @click="wxLoginCodeVisible=false">关闭</el-button> |
|
|
|
</el-popover> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -80,8 +83,7 @@ |
|
|
|
import { sendSmsCode } from '@/api/sms/sms'; |
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
import md5 from 'js-md5'; |
|
|
|
import { resetPasswordByPhoneno } from '@/api/login'; |
|
|
|
|
|
|
|
import { resetPasswordByPhoneno,getTpaState } from '@/api/login'; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'login', |
|
|
|
@ -178,6 +180,7 @@ export default { |
|
|
|
abledBut: false, //是否禁止 |
|
|
|
setTimeNum: 60, // 倒计时时间 |
|
|
|
timeWrap: null, // 定时器标识 |
|
|
|
wxLoginCodeVisible:false, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -324,6 +327,26 @@ export default { |
|
|
|
this.addBranchFormVisible=false; |
|
|
|
this.handleLogin(); |
|
|
|
}, |
|
|
|
weixinLogin(){ |
|
|
|
getTpaState().then(res=>{ |
|
|
|
var tips = res.data.tips; |
|
|
|
if(tips.isOk){ |
|
|
|
this.wxLoginCodeVisible=true; |
|
|
|
var state=res.data.data |
|
|
|
var obj = new WxLogin({ |
|
|
|
self_redirect:true, |
|
|
|
id:"login_container", |
|
|
|
appid: "wx2671d5db8346b6fc", |
|
|
|
scope: "snsapi_login", |
|
|
|
redirect_uri: encodeURIComponent("https://www.maimengcloud.com/api/m1/tpa/login/token?authType=wechat_wxpub&authId=mmxmcloud_wxopen_pc"), |
|
|
|
state: state, |
|
|
|
style: "", |
|
|
|
href: "" |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
afterQRScan() { |
|
|
|
// const hash = window.location.hash.slice(1) |
|
|
|
@ -350,6 +373,12 @@ export default { |
|
|
|
destroyed() { |
|
|
|
// window.removeEventListener('hashchange', this.afterQRScan) |
|
|
|
}, |
|
|
|
mounted(){ |
|
|
|
const s = document.createElement('script'); |
|
|
|
s.type = 'text/javascript'; |
|
|
|
s.src = 'https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js'; |
|
|
|
document.body.appendChild(s); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|