时间:2022-08-06 21:03:01 | 来源:网站运营
时间:2022-08-06 21:03:01 来源:网站运营
所有文章的源码将会被上传到github 仓库https://github.com/kurryluo/LearningByMyself,不用经过授权,即可转载所有文章和代码。https://open.weixin.qq.com/connect/qrconnect?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
需要注意的几点:- appid:wxbdc5610cc59c1631- redirect_uri: https%3A%2F%2Fpassport.yhd.com%2Fwechat%2Fcallback.do (已经编码过的)- response_type:code- scope:snsapi_login- state:3d6be0a4035d839573b04816624a415e
完整的登录地址:https://open.weixin.qq.com/connect/qrconnect?appid=wxbdc5610cc59c1631&redirect_uri=https%3A%2F%2Fpassport.yhd.com%2Fwechat%2Fcallback.do&response_type=code&scope=snsapi_login&state=3d6be0a4035d839573b04816624a415e#wechat_redirect
上面这个地址可以放在 a 标签里,用户点击即跳转到微信提供的登录页面。以下代码就可以实现。<a href = 'https://open.weixin.qq.com/connect/qrconnect?appid=wxbdc5610cc59c1631&redirect_uri=https%3A%2F%2Fpassport.yhd.com%2Fwechat%2Fcallback.do&response_type=code&scope=snsapi_login&state=3d6be0a4035d839573b04816624a415e#wechat_redirect'>直接跳转到微信提供的网页</a>
<Modal visible={open} onCancel={this.props.handleClose} footer={null} closable > <div className={styles.wechatLoginSec}> <div className={classnames(styles.imageSec, styles[toggleClass])}></div> <div className={styles.inputSec}> <iframe className={styles.nlogin_iframe} frameBorder="0" sandbox="allow-scripts allow-same-origin allow-top-navigation" scrolling="no" src="微信登录"></iframe> </div> </div> </Modal>
最终效果如动图:关键词:实现,自学