feat : login wx

This commit is contained in:
2024-11-11 17:22:02 +08:00
parent 2f9786bd05
commit 649d41f427
3 changed files with 7 additions and 1 deletions

View File

@@ -77,6 +77,6 @@ class ApiReturnAspect extends AbstractAspect
$logParam = !$post ? '{}' : json_encode($post); $logParam = !$post ? '{}' : json_encode($post);
$header = json_encode($this->request->getHeaders()); $header = json_encode($this->request->getHeaders());
$this->log->requestApiLog("\napi==path:{$this->request->getPathInfo()}\nuserId:$this->userId\nrequestData:$logParam\nheader:$header\nresponseData:$result"); $this->log->requestApiLog("\napi==path:{$this->request->getPathInfo()}\nuserId:$this->userId\nrequestData:$logParam\nheader:$header\nresponseData:$result\n");
} }
} }

View File

@@ -49,6 +49,7 @@ trait WxMiniTrait
*/ */
public function jsCodeGetOpenId(string $code): mixed public function jsCodeGetOpenId(string $code): mixed
{ {
var_dump(config('system.wx_appid'),config('system.wx_secret'));
$url = sprintf( $url = sprintf(
'/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code', '/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code',
config('system.wx_appid'), config('system.wx_appid'),

5
sync/http/api/user.http Normal file
View File

@@ -0,0 +1,5 @@
### 登录
POST {{host}}/api/login/index
Content-Type: application/x-www-form-urlencoded
login_type=wx_login&js_code=12222