Commit 950b4079 by zhangleyuan

Merge branch 'hotfix/zhangleyuan/20210426/qrcode' into gray

parents 88709708 3bad30ec
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-31 09:34:31
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-01-09 14:39:46
* @LastEditTime: 2021-04-27 16:59:07
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
......@@ -96,7 +96,6 @@ class Axios {
case 401:
User.removeUserId();
User.removeToken();
message.error('请登录');
window.RCHistory.replace('/login');
break;
case 403:
......
......@@ -34,7 +34,7 @@ function Login(props) {
User.setCustomerStoreId(storeId);
}
if (from === 'customer' && enterpriseId && userId) {
if (!user.getToken() || enterpriseId !== user.getEnterpriseId()) {
if (!user.getToken() || enterpriseId !== user.getEnterpriseId() || userId !== User.getUserId()) {
getWXWorkLoginNoCheck(enterpriseId, userId);
} else {
window.RCHistory.push({
......
import React, { useState, useRef, useEffect } from 'react';
import qrcode from '@/core/qrcode/qrcode.js'
import qrcode from "@/libs/qrcode/qrcode.js";
import Service from "@/common/js/service";
import User from '@/common/js/user';
import { PATH } from '@/domains/basic-domain/constants';
......@@ -7,6 +7,7 @@ import './WechatLogin.less'
const Logo = require("@/common/images/logo.png")
declare var location: any;
export default function WechatLogin(props: any) {
const freshTime = 60;
const init: any = null;
......@@ -31,15 +32,18 @@ export default function WechatLogin(props: any) {
// 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`
// console.log(url)
const qrcodeWrapDom:any = document.querySelector('#qrcode');
let qrnode = new qrcode({
text: redirect,
correctLevel: 2,
size: 160,
image: Logo,
imageSize: 50
});
QRCode.current.innerHTML = ''
QRCode.current.prepend(qrnode);
});
qrcodeWrapDom.innerHTML = '';
qrcodeWrapDom && qrcodeWrapDom.appendChild(qrnode);
// QRCode.current.innerHTML = ''
// QRCode.current.prepend(qrnode);
setLeftTime(freshTime);
timer.current = setInterval(() => {
if (leftTimeRef.current == 0) {
......@@ -85,9 +89,7 @@ export default function WechatLogin(props: any) {
return <div className='wechatLoginBox'>
<div className="rwm">
<div id="qrcode" ref={(dom) => {
QRCode.current = dom
}}></div>
<div id="qrcode"></div>
{
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