Commit abb5b1f3 authored by zhuwei's avatar zhuwei

bug

parent ff762813
<?php
namespace app\api\untils;
use think\Log;
/**
* 微信接口api
......@@ -43,6 +44,7 @@ class WxCallbackUntils
*/
public function getWxCode($redirect_url)
{
Log::record($redirect_url, 'rizhiheiheihei'); //记录日志
$redirect_url = urlencode($redirect_url);
$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" . $this->appId . "&redirect_uri="
. $redirect_url . "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
......@@ -101,6 +103,8 @@ class WxCallbackUntils
}
/**
* 静默授权,用户无感知
* @param $redirect_url
......@@ -126,6 +130,7 @@ class WxCallbackUntils
return $open_id;
}
public function curl($url, $data = [])
{
$ch = curl_init();
......
......@@ -426,7 +426,7 @@ class Broker extends Basic
/**
* 客户动态展示加搜索加客户详情
*
* APP客户详情
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
......
......@@ -28,7 +28,7 @@ class ShareShop extends Basic
parent::__construct();
$this->_wxApi = new WxCallbackUntils();
$this->wxInfoModel = new UWxInfo();
$this->url = CURRENT_URL . "/index/shareShop";
$this->url = CURRENT_URL . "index/shareShop";
}
public function shareShop()
......@@ -45,8 +45,7 @@ class ShareShop extends Basic
//dump($userInfo);exit;
if (!$userInfo['wx_open_id']) {
$this->_wxApi->getWxCode($this->url.'?'.http_build_query($params));
}
}else{
$wx_union_id = $userInfo['wx_union_id'] ? $userInfo['wx_union_id'] : $userInfo['wx_open_id'];
if(!$userInfo['wx_union_id']){
$userInfo['wx_union_id'] = $userInfo['wx_open_id'];
......@@ -69,20 +68,10 @@ class ShareShop extends Basic
$params['wx_union_id'] = $wx_union_id;
$params['device_id'] = $this->createOrderNumber();
}
}
/* $data = [
'id' => '1',
'housename' => '怡华苑路304号',
'user_tel' => '13918937741',
'user_name' => '于盼盼',
'share' => '1',
'client' => 'b',
'is_user' => true
];*/
dump($params);
}
}
dump($wx_union_id);
$this->assign('data',json_encode($params));
return view("share_detail");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment