#tradewind:update wechat auth

This commit is contained in:
tradewind 2021-06-24 16:18:38 +08:00
parent 4366c4a2ef
commit 6da5389988
2 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -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');
});
});