#tradewind:update wechat auth

master
tradewind 4 years ago
parent 4366c4a2ef
commit 6da5389988
  1. 12
      app/Http/Controllers/Api/WechatAuthController.php
  2. 2
      routes/api.php

@ -8,7 +8,17 @@ use Illuminate\Http\Request;
class WechatAuthController extends Controller
{
//
public function checkSign(Request $request)
public function auth(Request $request)
{
if ($this->checkSign($request)) {
return $request->echostr;
}
return false;
}
private function checkSign($request)
{
$signature = $request->signature;
$timestamp = $request->timestamp;

@ -24,7 +24,7 @@ Route::namespace('Api')->prefix('v1')->group(function () {
Route::any('/test', [TestController::class, 'index'])->name('test.index');
Route::prefix('wechat')->group(function () {
Route::get('/auth', [WechatAuthController::class, 'checkSign'])->name('wechat.auth.checkSign');
Route::get('/auth', [WechatAuthController::class, 'auth'])->name('wechat.auth.auth');
});
});

Loading…
Cancel
Save