tp6开放平台微信扫码登录
一、准备资料:
1.注册账户 https://open.weixin.qq.com/
注册成功 配置回调函数
2、开发者认证:企业。
3、创建一个网站应用:网站域名必须备案(可使用二级域名),获得相应的AppID和AppSecret,申请微信登录且通过审核。
二、接入微信登录步骤:
首先看下微信官网给出的步骤说明:
ttps://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html
- 第三方发起微信授权登录请求,微信用户允许授权第三方应用后,微信会拉起应用或重定向到第三方网站,并且带上授权临时票据code参数;
- 通过code参数加上AppID和AppSecret等,通过API换取access_token;
- 通过access_token进行接口调用,获取用户基本数据资源或帮助用户实现基本操作.
三 代码步骤
1.html端展示
1-1微信同步扫码登录
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js">&