feat : basic

This commit is contained in:
2024-11-12 11:02:38 +08:00
parent 235acbea9c
commit a9f81888b7
26 changed files with 342 additions and 209 deletions

View File

@@ -10,7 +10,7 @@ declare(strict_types=1);
namespace App\Service\Api\Login;
use App\Exception\ApiException;
use App\Exception\ErrException;
use App\Model\UserThird;
use App\Service\ServiceTrait\Api\WxMiniTrait;
use Hyperf\DbConnection\Db;
@@ -37,7 +37,7 @@ class WxFastLoginService extends LoginBaseService
{
$this->jsCode = $this->request->input('js_code');
if (empty($this->jsCode)) throw new ApiException('登录参数错误');
if (empty($this->jsCode)) throw new ErrException('登录参数错误');
$wxInfo = $this->jsCodeGetOpenId($this->jsCode);
$this->openId = $wxInfo['openid'];
@@ -88,6 +88,6 @@ class WxFastLoginService extends LoginBaseService
$model->open_id = $this->openId;
$model->union_id = $this->unionId;
if (!$model->save()) throw new ApiException('注册失败-00001');
if (!$model->save()) throw new ErrException('注册失败-00001');
}
}