feat : wx login
This commit is contained in:
20
app/Controller/Api/UserController.php
Normal file
20
app/Controller/Api/UserController.php
Normal 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()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
8
app/Middleware/Api/JwtAuthMiddleware.php
Normal file
8
app/Middleware/Api/JwtAuthMiddleware.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Middleware\Api;
|
||||||
|
|
||||||
|
class JwtAuthMiddleware
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -68,7 +68,7 @@ trait WxMiniTrait
|
|||||||
|
|
||||||
$res = json_decode($contents,true);
|
$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;
|
return $res;
|
||||||
}catch (GuzzleException $e) {
|
}catch (GuzzleException $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user