Commit 47c55ff6 by zhangleyuan

feat:处理二维码在企微环境下不展示的问题

parent 306123ce
...@@ -32,6 +32,7 @@ export default function WechatLogin(props: any) { ...@@ -32,6 +32,7 @@ export default function WechatLogin(props: any) {
// console.log(redirect) // console.log(redirect)
// const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww409ccf9c6e31f19e&redirect_uri=${encodeURIComponent(redirect)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect` // const url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww409ccf9c6e31f19e&redirect_uri=${encodeURIComponent(redirect)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
// console.log(url) // console.log(url)
const qrcodeWrapDom:any = document.querySelector('#qrcode');
let qrnode = new qrcode({ let qrnode = new qrcode({
text: redirect, text: redirect,
correctLevel: 2, correctLevel: 2,
...@@ -39,8 +40,9 @@ export default function WechatLogin(props: any) { ...@@ -39,8 +40,9 @@ export default function WechatLogin(props: any) {
image: Logo, image: Logo,
imageSize: 50 imageSize: 50
}); });
QRCode.current.innerHTML = '' qrcodeWrapDom && qrcodeWrapDom.appendChild(qrnode);
QRCode.current.prepend(qrnode); // QRCode.current.innerHTML = ''
// QRCode.current.prepend(qrnode);
setLeftTime(freshTime); setLeftTime(freshTime);
timer.current = setInterval(() => { timer.current = setInterval(() => {
if (leftTimeRef.current == 0) { if (leftTimeRef.current == 0) {
...@@ -86,9 +88,7 @@ export default function WechatLogin(props: any) { ...@@ -86,9 +88,7 @@ export default function WechatLogin(props: any) {
return <div className='wechatLoginBox'> return <div className='wechatLoginBox'>
<div className="rwm"> <div className="rwm">
<div id="qrcode" ref={(dom) => { <div id="qrcode"></div>
QRCode.current = dom
}}></div>
{ {
status === 1 && <div className="error"> status === 1 && <div className="error">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment