feat : wx login

This commit is contained in:
2024-11-25 11:42:28 +08:00
parent 8bb59f693e
commit af46572405
3 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace App\Controller\Api;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\Validation\Annotation\Scene;
#[Controller(prefix: 'api/user')]
class UserController
{
#[RequestMapping(path: 'bind/phone',methods: 'post')]
#[Scene(scene: 'bind_phone')]
public function bind_phone()
{
}
}

View File

@@ -0,0 +1,8 @@
<?php
namespace App\Middleware\Api;
class JwtAuthMiddleware
{
}

View File

@@ -68,7 +68,7 @@ trait WxMiniTrait
$res = json_decode($contents,true);
if (empty($res['errcode']) || $res['errcode'] != 0) throw new ErrException($res['errmsg'] ?? '系统繁忙');
if (!empty($res['errcode']) && $res['errcode'] != 0) throw new ErrException($res['errmsg'] ?? '系统繁忙');
return $res;
}catch (GuzzleException $e) {