This commit is contained in:
尖叫 2023-12-08 11:15:12 +08:00
parent ff56dcd1b4
commit d8cf28aeef

View File

@ -134,7 +134,7 @@ class User extends Controller
*/ */
public function getWxUserCoupon() public function getWxUserCoupon()
{ {
$post = $this->request->post(); $post = $this->request->get();
$where = [ $where = [
'openid' => $post['openid'], 'openid' => $post['openid'],
]; ];
@ -194,7 +194,7 @@ class User extends Controller
if (isset($result['access_token'])) { if (isset($result['access_token'])) {
$access_token = $result['access_token']; $access_token = $result['access_token'];
$openid = $result['openid']; $openid = $result['openid'];
$wx_url = "https://api.weixin.qq.com/sns/userinfo?access_token=$access_token&openid=$openid&lang=zh_CN"; $wx_url = "https://api.weixin.qq.com/sns/userinfo?access_token=$access_token&openid=$openid&lang=zh_CN";
$data = json_decode(Http::get($wx_url), true); $data = json_decode(Http::get($wx_url), true);
if (isset($data['headimgurl'])) { if (isset($data['headimgurl'])) {