微信登录
绑定微信公众号登录网站
配置微信公众号信息
进入微信公众号平台:https://mp.weixin.qq.com/
设置与开发 - 基本配置 - 记录AppID
和AppSecret
,设置白名单,白名单就是你网站的IP。
将AppID
和AppSecret
填入网站后台,系统配置 - 微信登录配置 - 填写对应的appid
appsecret
,并设置token
。
在公众号上面,配置服务器地址(URL):http://域名/wechat/index
,令牌(Token) 上面设置的token
,消息加解密方式设置为明文模式
。
配置完,点击启用
微信登录
登录链接:
http://域名/wechat/login
<a href="{fun U('wechat/login')}">微信登录</a>