diff --git a/.gitignore b/.gitignore index c0e6395..587e141 100644 --- a/.gitignore +++ b/.gitignore @@ -26,5 +26,6 @@ upload/ /storage/logs/* /app/certs/ up.sh +composer.lock diff --git a/app/Classc/GoogleAuthenticator.php b/app/Classc/GoogleAuthenticator.php new file mode 100644 index 0000000..a32cf0b --- /dev/null +++ b/app/Classc/GoogleAuthenticator.php @@ -0,0 +1,297 @@ +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; + } +} diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index e91dae3..276c210 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -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' => '旧密码' ]; } } diff --git a/app/Http/Controllers/Admin/LoginController.php b/app/Http/Controllers/Admin/LoginController.php index 3806c5f..e2febb9 100644 --- a/app/Http/Controllers/Admin/LoginController.php +++ b/app/Http/Controllers/Admin/LoginController.php @@ -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); } diff --git a/app/Http/Controllers/Web/OrderController.php b/app/Http/Controllers/Web/OrderController.php index 145c7ee..25347d3 100644 --- a/app/Http/Controllers/Web/OrderController.php +++ b/app/Http/Controllers/Web/OrderController.php @@ -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); } diff --git a/app/ServicePay/BasePay.php b/app/ServicePay/BasePay.php index c278b22..7d4eb0c 100644 --- a/app/ServicePay/BasePay.php +++ b/app/ServicePay/BasePay.php @@ -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)) { diff --git a/app/ServicePay/PayApiProvidesTrait.php b/app/ServicePay/PayApiProvidesTrait.php index 84ef88e..2417569 100644 --- a/app/ServicePay/PayApiProvidesTrait.php +++ b/app/ServicePay/PayApiProvidesTrait.php @@ -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': diff --git a/app/ServicePay/QunHongBaoServices.php b/app/ServicePay/QunHongBaoServices.php index b59697a..5bd819e 100644 --- a/app/ServicePay/QunHongBaoServices.php +++ b/app/ServicePay/QunHongBaoServices.php @@ -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()) { diff --git a/composer.json b/composer.json index 4d277b5..8492b4d 100644 --- a/composer.json +++ b/composer.json @@ -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 } diff --git a/composer.lock b/composer.lock index f4096e3..690ca82 100644 --- a/composer.lock +++ b/composer.lock @@ -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" } diff --git a/config/adconfig.php b/config/adconfig.php index 4c566cb..494db64 100644 --- a/config/adconfig.php +++ b/config/adconfig.php @@ -73,6 +73,7 @@ return [ '1012' =>'微信红包', '1013' =>'微信慢充扫码', '1014' =>'fx_支付宝直充', + '1015' =>'微信直充扫码', ], 'payfor_status' => [ 0 => '等待处理', diff --git a/config/whitelist.php b/config/whitelist.php index 5f99f28..6b7c6b0 100644 --- a/config/whitelist.php +++ b/config/whitelist.php @@ -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' diff --git a/resources/views/admin/auth/login.blade.php b/resources/views/admin/auth/login.blade.php index dd3de06..330700f 100644 --- a/resources/views/admin/auth/login.blade.php +++ b/resources/views/admin/auth/login.blade.php @@ -35,6 +35,11 @@ +