Commit 2fc08357 authored by zw's avatar zw

Merge branch 'test'

parents b163621f 65b6819f
......@@ -21,16 +21,8 @@ class WxCallbackUntils
public function __construct()
{
if (strpos($this->http_host(), 'api') !== false) {
Log::write('正式服', 'WxCallbackUntils'); //记录日志
$this->appId = "wxbbeb8cd2f4b72aea";
$this->appSecret = "9ac6d1680553f4b554f3b46d263fbfb3";
} else {
Log::write('测试服', 'WxCallbackUntils'); //记录日志
$this->appId = "wxd30d74d1126d3278";//测试
$this->appSecret = "f29c8c502549020d2193a464be9632dc";//测试
}
$this->appId = "wxbbeb8cd2f4b72aea";
$this->appSecret = "9ac6d1680553f4b554f3b46d263fbfb3";
}
public function http_host()
......
......@@ -36,14 +36,15 @@ class ShareShop extends Basic
$browser_type = $this->isWeiChatBrowser();
$params = $this->params;
$is_user = true;
if($browser_type == 1){
if($browser_type == 1 && empty($params['wx_union_id'])){
//dump('微信浏览器');
$code = empty($_GET['code']) ? null : $_GET['code'];
if (!$code) {
$this->_wxApi->getWxCode($this->url.'?'.http_build_query($params));
} else {
$userInfo = $this->_wxApi->getUserInfoByAccessToken($code);
Log::write(json_encode($userInfo), 'WxCallbackUntils'); //记录日志
//dump($userInfo);exit;
if (!$userInfo['wx_open_id']) {
$this->_wxApi->getWxCode($this->url.'?'.http_build_query($params));
......@@ -73,7 +74,6 @@ class ShareShop extends Basic
}
}
Log::write(json_encode($params), 'WxCallbackUntils'); //记录日志
$this->assign('data',json_encode($params));
return view("share_detail");
......@@ -113,6 +113,4 @@ class ShareShop extends Basic
}
}
}
\ No newline at end of file
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