raysoft/wxauth-server

通过认证的公众号实现网页扫描登录(服务端)

1.0.3 2017-03-14 14:22 UTC

This package is not auto-updated.

Last update: 2024-09-18 19:49:12 UTC


README

通过认证的公众号实现网页扫描登录(服务端)

这是一个Yii2模块,需要在Yii2框架下运行

使用场景

  1. 拥有认证过的微信公众号
  2. 没有开发者账号(正常使用微信扫描登录需要申请开发者账号,费用为300元,每个网站都需要提交资料,审核,非常麻烦)
  3. WEB端希望通过扫描登录

安装使用

1、通过composer安装: composer require raysoft/wxauth-server

2、在Yii2项目根目录运行脚本创建数据表: php yii migrate --migrationPath=vendor/raysoft/wxauth-server/migrations

3、配置模块

'modules' => [
    ...
    'wxauth' => [ // 配置模块名, 客户端连接服务端需要用到这个
        'class' => 'raysoft\WxAuthServer\Module'
    ]
    ...
  ]

4、在wxlogin_app表中添加一条记录,对应一个客户端,以下为必填项

name: 客户端名, 显示在用户授权界面
key: key名, 客户端以此确定身份
secret: 密钥, 用于签名