添加谷歌认证

This commit is contained in:
zcy 2021-10-15 17:45:19 +08:00
parent 17bfb1de66
commit a62b14c401
15 changed files with 777 additions and 155 deletions

1
.gitignore vendored
View File

@ -26,5 +26,6 @@ upload/
/storage/logs/*
/app/certs/
up.sh
composer.lock

View File

@ -0,0 +1,297 @@
<?php
namespace App\Classc;
use Exception;
/**
* PHP Class for handling Google Authenticator 2-factor authentication.
*
* require_once 'PHPGangsta/GoogleAuthenticator.php';
*
* $ga = new PHPGangsta_GoogleAuthenticator();
* $secret = $ga->createSecret();
* echo "Secret is: ".$secret."\n\n";
*
* $qrCodeUrl = $ga->getQRCodeGoogleUrl('Blog', $secret);
* echo "Google Charts URL for the QR-Code: ".$qrCodeUrl."\n\n";
*
* $oneCode = $ga->getCode($secret);
* echo "Checking Code '$oneCode' and Secret '$secret':\n";
*
* $checkResult = $ga->verifyCode($secret, $oneCode, 2); // 2 = 2*30sec clock tolerance
* if ($checkResult) {
* echo 'OK';
* } else {
* echo 'FAILED';
* }
*Secret is: OQB6ZZGYHCPSX4AK
*
* Google Charts URL for the QR-Code: https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/infoATphpgangsta.de%3Fsecret%3DOQB6ZZGYHCPSX4AK
*
* Checking Code '848634' and Secret 'OQB6ZZGYHCPSX4AK':
* OK
*
*
* @author Michael Kliewe
* @copyright 2012 Michael Kliewe
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*
* @link http://www.phpgangsta.de/
*/
class GoogleAuthenticator
{
protected $_codeLength = 6;
/**
* Create new secret.
* 16 characters, randomly chosen from the allowed base32 characters.
*
* @param int $secretLength
*
* @return string
* @throws \Exception
*/
public function createSecret($secretLength = 16)
{
$validChars = $this->_getBase32LookupTable();
// Valid secret lengths are 80 to 640 bits
if ($secretLength < 16 || $secretLength > 128) {
throw new Exception('Bad secret length');
}
$secret = '';
$rnd = false;
if (function_exists('random_bytes')) {
$rnd = random_bytes($secretLength);
} elseif (function_exists('mcrypt_create_iv')) {
$rnd = mcrypt_create_iv($secretLength, MCRYPT_DEV_URANDOM);
} elseif (function_exists('openssl_random_pseudo_bytes')) {
$rnd = openssl_random_pseudo_bytes($secretLength, $cryptoStrong);
if (!$cryptoStrong) {
$rnd = false;
}
}
if ($rnd !== false) {
for ($i = 0; $i < $secretLength; ++$i) {
$secret .= $validChars[ord($rnd[$i]) & 31];
}
} else {
throw new Exception('No source of secure random');
}
return $secret;
}
/**
* Calculate the code, with given secret and point in time.
*
* @param string $secret
* @param int|null $timeSlice
*
* @return string
*/
public function getCode($secret, $timeSlice = null)
{
if ($timeSlice === null) {
$timeSlice = floor(time() / 30);
}
$secretkey = $this->_base32Decode($secret);
// Pack time into binary string
$time = chr(0).chr(0).chr(0).chr(0).pack('N*', $timeSlice);
// Hash it with users secret key
$hm = hash_hmac('SHA1', $time, $secretkey, true);
// Use last nipple of result as index/offset
$offset = ord(substr($hm, -1)) & 0x0F;
// grab 4 bytes of the result
$hashpart = substr($hm, $offset, 4);
// Unpak binary value
$value = unpack('N', $hashpart);
$value = $value[1];
// Only 32 bits
$value = $value & 0x7FFFFFFF;
$modulo = pow(10, $this->_codeLength);
return str_pad($value % $modulo, $this->_codeLength, '0', STR_PAD_LEFT);
}
/**
* Get QR-Code URL for image, from google charts.
*
* @param string $name
* @param string $secret
* @param string $title
* @param array $params
*
* @return string
*/
public function getQRCodeGoogleUrl($name, $secret, $title = null, $params = array())
{
$width = !empty($params['width']) && (int) $params['width'] > 0 ? (int) $params['width'] : 200;
$height = !empty($params['height']) && (int) $params['height'] > 0 ? (int) $params['height'] : 200;
$level = !empty($params['level']) && array_search($params['level'], array('L', 'M', 'Q', 'H')) !== false ? $params['level'] : 'M';
$urlencoded = urlencode('otpauth://totp/'.$name.'?secret='.$secret.'');
if (isset($title)) {
$urlencoded .= urlencode('&issuer='.urlencode($title));
}
return 'https://chart.googleapis.com/chart?chs='.$width.'x'.$height.'&chld='.$level.'|0&cht=qr&chl='.$urlencoded.'';
}
/**
* 获取绑定二维码的信息
* @param $name
* @param $secret
* @param $title
* @return string
*/
public function getQrContent($name, $secret,$title){
$urlencoded = 'otpauth://totp/'.$name.'?secret='.urlencode($secret);
if (isset($title)) {
$urlencoded .= '&issuer='.urlencode($title);
}
return $urlencoded;
}
/**
* Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now.
*
* @param string $secret
* @param string $code
* @param int $discrepancy This is the allowed time drift in 30 second units (8 means 4 minutes before or after)
* @param int|null $currentTimeSlice time slice if we want use other that time()
*
* @return bool
*/
public function verifyCode($secret, $code, $discrepancy = 1, $currentTimeSlice = null)
{
if ($currentTimeSlice === null) {
$currentTimeSlice = floor(time() / 30);
}
if (strlen($code) != 6) {
return false;
}
for ($i = -$discrepancy; $i <= $discrepancy; ++$i) {
$calculatedCode = $this->getCode($secret, $currentTimeSlice + $i);
if ($this->timingSafeEquals($calculatedCode, $code)) {
return true;
}
}
return false;
}
/**
* Set the code length, should be >=6.
*
* @param int $length
*
* @return PHPGangsta_GoogleAuthenticator
*/
public function setCodeLength($length)
{
$this->_codeLength = $length;
return $this;
}
/**
* Helper class to decode base32.
*
* @param $secret
*
* @return bool|string
*/
protected function _base32Decode($secret)
{
if (empty($secret)) {
return '';
}
$base32chars = $this->_getBase32LookupTable();
$base32charsFlipped = array_flip($base32chars);
$paddingCharCount = substr_count($secret, $base32chars[32]);
$allowedValues = array(6, 4, 3, 1, 0);
if (!in_array($paddingCharCount, $allowedValues)) {
return false;
}
for ($i = 0; $i < 4; ++$i) {
if ($paddingCharCount == $allowedValues[$i] &&
substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])) {
return false;
}
}
$secret = str_replace('=', '', $secret);
$secret = str_split($secret);
$binaryString = '';
for ($i = 0; $i < count($secret); $i = $i + 8) {
$x = '';
if (!in_array($secret[$i], $base32chars)) {
return false;
}
for ($j = 0; $j < 8; ++$j) {
$x .= str_pad(base_convert(@$base32charsFlipped[@$secret[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
}
$eightBits = str_split($x, 8);
for ($z = 0; $z < count($eightBits); ++$z) {
$binaryString .= (($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48) ? $y : '';
}
}
return $binaryString;
}
/**
* Get array with all 32 characters for decoding from/encoding to base32.
*
* @return array
*/
protected function _getBase32LookupTable()
{
return array(
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
'=', // padding char
);
}
/**
* A timing safe equals comparison
* more info here: http://blog.ircmaxell.com/2014/11/its-all-about-time.html.
*
* @param string $safeString The internal (safe) value to be checked
* @param string $userString The user submitted (unsafe) value
*
* @return bool True if the two strings are identical
*/
private function timingSafeEquals($safeString, $userString)
{
if (function_exists('hash_equals')) {
return hash_equals($safeString, $userString);
}
$safeLen = strlen($safeString);
$userLen = strlen($userString);
if ($userLen != $safeLen) {
return false;
}
$result = 0;
for ($i = 0; $i < $userLen; ++$i) {
$result |= (ord($safeString[$i]) ^ ord($userString[$i]));
}
// They are only identical strings if $result is exactly 0...
return $result === 0;
}
}

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Admin;
use App\Classc\GoogleAuthenticator;
use App\Services\DateServices;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
@ -11,73 +12,120 @@ use App\Models\SystemUpdateLog;
class HomeController extends BaseController
{
public function index(){
$this->setTitle('网站后台');
if(is_mobile_client())
{
//$this->setViewPath('','mobile');
return redirect()->action('Admin\HomeController@console');
}
return $this->display();
public function index()
{
$this->setTitle('网站后台');
if (is_mobile_client()) {
//$this->setViewPath('','mobile');
return redirect()->action('Admin\HomeController@console');
}
return $this->display();
}
public function console(){
$data=[];
$data['day_before_7']=DateServices::decrDay('',6);
$data['update_log']=SystemUpdateLog::where('type','system')->limit(10)->orderBy('id','desc')->get();
public function console()
{
$data = [];
$data['day_before_7'] = DateServices::decrDay('', 6);
$data['update_log'] = SystemUpdateLog::where('type', 'system')->limit(10)->orderBy('id', 'desc')->get();
//DateServices::diffDay('2019-01-02','2019-01-05');
return $this->display($data);
}
public function online($id){
$this->setViewPath('','online');
$data=[
public function online($id)
{
$this->setViewPath('', 'online');
$data = [
];
return $this->display($data);
}
public function showNotice($id,$request){
$this->setViewPath('','notice');
$notice=NoticeArticle::find($id);
$data=[
'show'=>$notice
public function showNotice($id, $request)
{
$this->setViewPath('', 'notice');
$notice = NoticeArticle::find($id);
$data = [
'show' => $notice
];
return $this->display($data);
}
public function show($type,$id,Request $request){
return $this->$type($id,$request);
public function show($type, $id, Request $request)
{
return $this->$type($id, $request);
}
public function password($id){
$this->setViewPath('','password');
public function password($id)
{
$this->setViewPath('', 'password');
$data=[
$data = [
];
return $this->display($data);
}
public function update($method,Request $request){
public function googleAuth($id, Request $request)
{
$user = admin();
$this->setViewPath('', 'googleauth');
$googleAuthSecretLength = 24;
$ga = new GoogleAuthenticator();
$key = $ga->createSecret($googleAuthSecretLength);
$content = $ga->getQrContent($request->root(), $key, $user->account);
$data = ['secret' => $key, 'content' => $content];
return $this->display($data);
}
public function googleAuthUpdate(Request $request)
{
$code = $request->post('code');
$secret = $request->post('secret');
if (empty($secret) || empty($code)) {
return $this->alertError('验证码不能为空', 1);
}
$ga = new GoogleAuthenticator();
$user = admin();
$code = strval($code);
if ($ga->verifyCode($secret, $code)) {
$user->google_secret = $secret;
if ($user->save()) {
return $this->alertError('绑定成功', 0);
} else {
return $this->alertError('绑定失败', 1);
}
} else {
return $this->alertError('验证失败', 1);
}
}
public function update($method, Request $request)
{
return $this->$method($request);
}
public function passwordUpdate($request){
$error=$this->validatorForm($request,'password');
if(count($error)>0){
return $this->formError($error);
public function passwordUpdate($request)
{
$error = $this->validatorForm($request, 'password');
if (count($error) > 0) {
return $this->formError($error);
};
$user=admin();
$password=$request->input('password');
$old_password=$request->input('old_password');
$user = admin();
$password = $request->input('password');
$old_password = $request->input('old_password');
if (!Hash::check($old_password, $user->password)) {
return $this->alertError('旧密码不对');
}
$user->password=$password;
if($user->save())
{
return $this->alertError('修改密码成功',0);
$user->password = $password;
if ($user->save()) {
return $this->alertError('修改密码成功', 0);
}
return $this->alertError('修改密码失败',1);
return $this->alertError('修改密码失败', 1);
}
@ -88,10 +136,11 @@ class HomeController extends BaseController
'old_password' => 'required'
];
}
public function setErrorMsg()
{
return [
'old_password'=>'旧密码'
'old_password' => '旧密码'
];
}
}

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Admin;
use App\Classc\GoogleAuthenticator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Auth;
@ -151,6 +152,18 @@ class LoginController extends Controller
if ($this->attemptLogin($request)) {
$this->guard()->user();
$code = $request->post('code');
$user = admin();
if ($user->google_secret != '') {
if (empty($code)) {
return response()->json(['error' => 1, 'msg' => '验证码必填']);
}
$ga = new GoogleAuthenticator();
if (!$ga->verifyCode($user->google_secret, $code)) {
return response()->json(['error' => 1, 'msg' => '验证码错误']);
}
}
//通过之后响应
return $this->sendLoginResponse($request);
}

View File

@ -91,6 +91,7 @@ class OrderController extends BaseController
'order'=>[],
'backurl' => '',
];
Log::channel('pay_order')->info('查询订单返回', $data);
return response()->json($data);
}
$params=$request->input();
@ -114,6 +115,7 @@ class OrderController extends BaseController
'order'=>[],
'backurl' => '',
];
Log::channel('pay_order')->info('查询订单返回', $data);
return response()->json($data);
}
//查询这个订单是否已经支付
@ -129,6 +131,7 @@ class OrderController extends BaseController
'order'=>[],
'backurl' => '',
];
Log::channel('pay_order')->info('查询订单返回', $data);
return response()->json($data);
}
$orderData = [
@ -152,6 +155,7 @@ class OrderController extends BaseController
'order' =>$orderData
];
}
Log::channel('pay_order')->info('查询订单返回', $data);
return response()->json($data);
}

View File

@ -53,9 +53,10 @@ class BasePay{
$ip = request()->getClientIp();
if (isset($gate_way['whiteip'])) {
$whiteip = $gate_way['whiteip'];
if(empty($whiteip)){
if (empty($whiteip)) {
return true;
}
$whiteip = str_replace('\n', ',', $whiteip);
$ipArr = explode(',', $whiteip);
$this->debugLog('回调IP', [$ip, $whiteip]);
if (is_array($ipArr)) {

View File

@ -35,30 +35,30 @@ trait PayApiProvidesTrait
case 'tr_bank':
case 'tr_bank2':
return $this->pay_service = new GuMaPayServices();
case 'sanyecaopay_alipay':
return $this->pay_service = new SanyecaoPayServices();
case 'baobeiyepay_alipay':
return $this->pay_service = new BaobeiyePayServices();
case 'xianyupay_alipay':
return $this->pay_service = new XianYuPayServices();
case 'baoyingpay_alipay':
return $this->pay_service = new BaoYingPayServices();
case 'liangliangpay':
return $this->pay_service = new LiangLiangPayServices();
case 'xinbaoyingpay':
return $this->pay_service = new XinBaoYingPayServices();
case 'longepay':
return $this->pay_service = new LongEPayServices();
case 'wangfupay':
return $this->pay_service = new WangfuPayServices();
case 'dashengfupay':
return $this->pay_service = new DaShengPayServices();
case 'dalepay':
return $this->pay_service = new DaLePayServices();
case 'shandianpay':
return $this->pay_service = new ShanDianServices();
case 'rongyipay':
return $this->pay_service = new RongYiServices();
// case 'sanyecaopay_alipay':
// return $this->pay_service = new SanyecaoPayServices();
// case 'baobeiyepay_alipay':
// return $this->pay_service = new BaobeiyePayServices();
// case 'xianyupay_alipay':
// return $this->pay_service = new XianYuPayServices();
// case 'baoyingpay_alipay':
// return $this->pay_service = new BaoYingPayServices();
// case 'liangliangpay':
// return $this->pay_service = new LiangLiangPayServices();
// case 'xinbaoyingpay':
// return $this->pay_service = new XinBaoYingPayServices();
// case 'longepay':
// return $this->pay_service = new LongEPayServices();
// case 'wangfupay':
// return $this->pay_service = new WangfuPayServices();
// case 'dashengfupay':
// return $this->pay_service = new DaShengPayServices();
// case 'dalepay':
// return $this->pay_service = new DaLePayServices();
// case 'shandianpay':
// return $this->pay_service = new ShanDianServices();
// case 'rongyipay':
// return $this->pay_service = new RongYiServices();
case 'zhanxinpay':
return $this->pay_service = new ZhanXinPayServices();
case '1003':
@ -80,11 +80,11 @@ trait PayApiProvidesTrait
case '1008':
return $this->pay_service = new MiFengServices();
case '1009':
case '1011':
case '1015':
return $this->pay_service = new WangWangPayServices();
case '1010':
return $this->pay_service = new GGPayServices();
case '1011':
return $this->pay_service = new WangWangPayServices();
case '1012':
return $this->pay_service = new QunHongBaoServices();
case '1013':

View File

@ -97,10 +97,10 @@ class QunHongBaoServices extends BasePay implements PayApiInterface
array_push($data, "{$value}");
}
}
$keyVal = implode('', $data);
$keyVal = implode(',', $data);
if (!empty($signKey) && is_string($signKey)) {
$keyVal .= $signKey;
$keyVal = $keyVal.','.$signKey;
}
return md5($keyVal);
}
@ -203,11 +203,11 @@ class QunHongBaoServices extends BasePay implements PayApiInterface
$this->result_data = $allData;
// $this->debugLog('回调原始数据', $this->result_data);
//检查三方的订单
$checkorder = $this->checkOrder($order_sn);
if (!$checkorder) {
$this->debugLog('查询三方订单未支付成功');
return '查询三方订单未支付成功';
}
// $checkorder = $this->checkOrder($order_sn);
// if (!$checkorder) {
// $this->debugLog('查询三方订单未支付成功');
// return '查询三方订单未支付成功';
// }
// dump($this->result_data);
//进行验证签名
if (!$this->verify()) {

View File

@ -1,82 +1,82 @@
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.2.0",
"ext-json": "*",
"ext-curl": "*",
"barryvdh/laravel-debugbar": "^3.1",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.4",
"ixudra/curl": "^6.16",
"jacobcyl/ali-oss-storage": "^2.1",
"jenssegers/date": "^3.4",
"laravel/framework": "6.4.0",
"laravel/helpers": "^1.1",
"laravel/tinker": "^1.0",
"lokielse/omnipay-unionpay": "dev-master",
"maatwebsite/excel": "3.1.17",
"mews/purifier": "^3.1",
"phpoffice/phpspreadsheet": "^1.4",
"predis/predis": "^1.1",
"qcloudsms/qcloudsms_php": "^0.1.4",
"spatie/laravel-permission": "3.2.0",
"yansongda/laravel-pay": "^2.1",
"yansongda/pay": "^2.8"
},
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"psr-4": {
"App\\": "app/"
"license": "MIT",
"type": "project",
"require": {
"php": "^7.2.0",
"ext-curl": "*",
"ext-json": "*",
"barryvdh/laravel-debugbar": "^3.1",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.4",
"ixudra/curl": "^6.16",
"jacobcyl/ali-oss-storage": "^2.1",
"jenssegers/date": "^3.4",
"laravel/framework": "6.4.0",
"laravel/helpers": "^1.1",
"laravel/tinker": "^1.0",
"lokielse/omnipay-unionpay": "dev-master",
"maatwebsite/excel": "3.1.17",
"mews/purifier": "^3.1",
"phpoffice/phpspreadsheet": "^1.4",
"predis/predis": "^1.1",
"qcloudsms/qcloudsms_php": "^0.1.4",
"simplesoftwareio/simple-qrcode": "^4.2",
"spatie/laravel-permission": "3.2.0",
"yansongda/laravel-pay": "^2.1",
"yansongda/pay": "^2.8"
},
"files": [
"app/Http/Helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/Http/Helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}

177
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "098512b617a754e9611101174a7ba28e",
"content-hash": "cf4d1148802166682fc8a4df56656b07",
"packages": [
{
"name": "aliyuncs/oss-sdk-php",
@ -53,6 +53,59 @@
"homepage": "http://www.aliyun.com/product/oss/",
"time": "2019-11-15T11:05:42+00:00"
},
{
"name": "bacon/bacon-qr-code",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/Bacon/BaconQrCode.git",
"reference": "f73543ac4e1def05f1a70bcd1525c8a157a1ad09"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/f73543ac4e1def05f1a70bcd1525c8a157a1ad09",
"reference": "f73543ac4e1def05f1a70bcd1525c8a157a1ad09",
"shasum": ""
},
"require": {
"dasprid/enum": "^1.0.3",
"ext-iconv": "*",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"phly/keep-a-changelog": "^1.4",
"phpunit/phpunit": "^7 | ^8 | ^9",
"squizlabs/php_codesniffer": "^3.4"
},
"suggest": {
"ext-imagick": "to generate QR code images"
},
"type": "library",
"autoload": {
"psr-4": {
"BaconQrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "BaconQrCode is a QR code generator for PHP.",
"homepage": "https://github.com/Bacon/BaconQrCode",
"support": {
"issues": "https://github.com/Bacon/BaconQrCode/issues",
"source": "https://github.com/Bacon/BaconQrCode/tree/2.0.4"
},
"time": "2021-06-18T13:26:35+00:00"
},
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.2.8",
@ -185,6 +238,53 @@
],
"time": "2019-04-09T12:31:48+00:00"
},
{
"name": "dasprid/enum",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/DASPRiD/Enum.git",
"reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/5abf82f213618696dda8e3bf6f64dd042d8542b2",
"reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "^7 | ^8 | ^9",
"squizlabs/php_codesniffer": "^3.4"
},
"type": "library",
"autoload": {
"psr-4": {
"DASPRiD\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "PHP 7.1 enum implementation",
"keywords": [
"enum",
"map"
],
"support": {
"issues": "https://github.com/DASPRiD/Enum/issues",
"source": "https://github.com/DASPRiD/Enum/tree/1.0.3"
},
"time": "2020-10-02T16:03:48+00:00"
},
{
"name": "dnoegel/php-xdg-base-dir",
"version": "0.1",
@ -3702,6 +3802,74 @@
],
"time": "2018-07-19T23:38:55+00:00"
},
{
"name": "simplesoftwareio/simple-qrcode",
"version": "4.2.0",
"source": {
"type": "git",
"url": "https://github.com/SimpleSoftwareIO/simple-qrcode.git",
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SimpleSoftwareIO/simple-qrcode/zipball/916db7948ca6772d54bb617259c768c9cdc8d537",
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537",
"shasum": ""
},
"require": {
"bacon/bacon-qr-code": "^2.0",
"ext-gd": "*",
"php": ">=7.2|^8.0"
},
"require-dev": {
"mockery/mockery": "~1",
"phpunit/phpunit": "~9"
},
"suggest": {
"ext-imagick": "Allows the generation of PNG QrCodes.",
"illuminate/support": "Allows for use within Laravel."
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider"
],
"aliases": {
"QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode"
}
}
},
"autoload": {
"psr-4": {
"SimpleSoftwareIO\\QrCode\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Simple Software LLC",
"email": "support@simplesoftware.io"
}
],
"description": "Simple QrCode is a QR code generator made for Laravel.",
"homepage": "https://www.simplesoftware.io/#/docs/simple-qrcode",
"keywords": [
"Simple",
"generator",
"laravel",
"qrcode",
"wrapper"
],
"support": {
"issues": "https://github.com/SimpleSoftwareIO/simple-qrcode/issues",
"source": "https://github.com/SimpleSoftwareIO/simple-qrcode/tree/4.2.0"
},
"time": "2021-02-08T20:43:55+00:00"
},
{
"name": "spatie/laravel-permission",
"version": "3.2.0",
@ -7477,7 +7645,10 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^7.2.0"
"php": "^7.2.0",
"ext-curl": "*",
"ext-json": "*"
},
"platform-dev": []
"platform-dev": [],
"plugin-api-version": "2.0.0"
}

View File

@ -73,6 +73,7 @@ return [
'1012' =>'微信红包',
'1013' =>'微信慢充扫码',
'1014' =>'fx_支付宝直充',
'1015' =>'微信直充扫码',
],
'payfor_status' => [
0 => '等待处理',

View File

@ -34,6 +34,13 @@ return [
'113.130.126.248',
'1.14.138.207',
'43.128.19.164',
'117.20.113.77',
'203.144.75.167',
'203.144.75.66',
'156.255.88.48',
'1.14.138.207',
'42.193.190.74',
'43.132.238.46',
],
'api'=>[
'45.195.84.39'
@ -65,7 +72,9 @@ return [
// '110.40.130.107',
],
'1003'=>[
'117.120.61.66'
'117.120.61.66',
'13.212.67.253',
'3.1.212.208'
],
'1000'=>[
'47.243.44.247'

View File

@ -35,6 +35,11 @@
<input type="password" name="password" id="LAY-user-login-password" lay-verify="rq"
placeholder="密码" value="" class="layui-input">
</div>
<div class="layui-form-item">
<label class="layadmin-user-login-icon layui-icon"></label>
<input type="text" name="code" lay-verify="rq"
placeholder="谷歌验证码(没有绑定就不需要填)" value="" class="layui-input">
</div>
{{--<div class="layui-form-item">
<div class="layui-row">
<div class="layui-col-xs7">

View File

@ -0,0 +1,69 @@
@extends('merchant.layouts.base')
@section('content')
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">绑定谷歌验证码</div>
<div class="layui-card-body" pad15>
<div class="layui-form layui-form-pane" lay-filter="layuiadmin-form-role" id="layuiadmin-form-role">
<div class="layui-form-item">
<label class="layui-form-label">二维码</label>
<div class="visible-print">
{!! QrCode::size(100)->generate($content); !!}
</div>
</div>
<div class="layui-form-item" style="display: none">
<label class="layui-form-label"></label>
<div class="layui-input-inline">
<input type="text" name="secret" value="{{$secret}}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">验证码</label>
<div class="layui-input-inline">
<input type="text" name="code" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="LAY-form-submit">确认修改</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('add_js')
<script>
layui.use(['index', 'form', 'verify', 'custorm'], function () {
var $ = layui.$
, custorm = layui.custorm
, form = layui.form;
update_url = "{{ admin_url('Home','update',['googleAuthUpdate']) }}"
form.on('submit(LAY-form-submit)', function (data) {
var field = data.field; //获取提交的字段
console.log(field);
$.ajax({
url: update_url,
type: 'post',
data: field,
success: function (res) {
layer.msg(res.msg);
$("input").val('')
}
});
});
});
</script>
@endsection

View File

@ -54,6 +54,8 @@
<dd><a lay-href="{{ admin_url('Home','show',['password','set']) }}">修改密码</a></dd>
<hr>
<dd><a lay-href="{{ admin_url('Home','show',['googleAuth','set']) }}">获取二维码</a></dd>
<hr>
<dd style="text-align: center;"><a href="{{ route('admin.logout') }}">退出</a></dd>
</dl>
</li>