多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
**下载谷歌验证类库文件放到项目合适位置(我这边放在项目Vender下面)** ~~~ /引入谷歌验证器类 vendor('googleAuth.GoogleAuthenticator-master.PHPGangsta.GoogleAuthenticator'); $ga = new \PHPGangsta_GoogleAuthenticator(); //这是生成的密钥,每个用户唯一一个,为用户保存起来用于验证 $secret = $ga->createSecret(); //echo $secret; //下面为生成二维码,内容是一个URI地址(otpauth://totp/账号?secret=密钥&issuer=标题) $qrCodeUrl = $ga->getQRCodeGoogleUrl('luokakale', $secret, 'googleVerify'); //echo $qrCodeUrl; ~~~ ![](https://img.kancloud.cn/96/87/9687a8ee9b615ec0db73ff3cc642eeef_717x422.png)