// 核心库 import React, { Component } from "react"; import { connect } from "dva"; import { withRouter } from "dva/router"; import QRCode from "qrcode"; import config from "../../config"; class GuideCanvas extends Component { constructor(props) { super(props); this.state = { visible: "none", company: "XLK", }; } componentDidMount() { QRCode.toCanvas( config.guideSeverHost, { errorCorrectionLevel: "L", width: 140 }, function (err, canvas) { if (err) throw err; let container = document.getElementById("canvas1"); if (container) { try { container.appendChild(canvas); } catch (e) { } } } ); QRCode.toCanvas( config.guideH5Host, { errorCorrectionLevel: "L", width: 140 }, function (err, canvas) { if (err) throw err; let container1 = document.getElementById("canvas2"); if (container1) { try { container1.appendChild(canvas); } catch (e) { } } } ); QRCode.toCanvas( config.h5Web + "?OrgId=" + this.props.login.OrgId, { errorCorrectionLevel: "L", width: 140 }, function (err, canvas) { if (err) throw err; let container1 = document.getElementById("canvas3"); if (container1) { try { container1.appendChild(canvas); } catch (e) { } } } ); // 二维码平台 QRCode.toCanvas( config.h5Web+'?OrgId='+this.props.login.OrgId , { errorCorrectionLevel: "L", width: 140 }, function (err, canvas) { if (err) throw err; let container = document.getElementById("canvas5"); if (container) { try { container.appendChild(canvas); } catch (e) { } } } ); } render() { return (
APP下载
手机登录
新员工注册
二维码平台
); } } export default withRouter(connect(({ login }) => ({ login }))(GuideCanvas));