相对应的php 谷歌验证器 三方插件源码链接:
https://download.csdn.net/download/lxp199741/12597978
//验证
preg_match('/^\d{6}$/',$google,$reginfo);
if(!$reginfo)return $this->error(lang('请输入6位纯数字谷歌验证码'));
include(dirname(dirname(__FILE__))."/googleAuthenticator/GoogleAuthenticator.php");
$ga = new \PHPGangsta_GoogleAuthenticator();
$checkResult = $ga->verifyCode($result['google_secret'],input('post.google'));
if(!$checkResult)return $this->error(lang('google验证失败请重试!'));
//生成
include(dirname(dirname(__FILE__))."/googleAuthenticator/GoogleAuthenticator.php");
$ga = new \PHPGangsta_GoogleAuthenticator();
$data['google_secret'] = $ga->createSecret();
$data['google_url'] = $qrCodeUrl = $ga->getQRCodeGoogleUrl('zjwlgr@163.com', $data['google_secret']);
return $data;