...
|
...
|
@@ -523,25 +523,25 @@ class LoginController extends HomeBaseController |
|
|
|
|
|
//获取微信分享配置信息
|
|
|
public function wxShare($url=''){
|
|
|
// $jsapiTicket = $this->getSignature();
|
|
|
// // 注意 URL 一定要动态获取,不能 hardcode.
|
|
|
// $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
|
|
// if($url === '') {
|
|
|
// $url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
|
|
// }
|
|
|
// $timestamp = time();
|
|
|
// $nonceStr = $this->createNonceStr();
|
|
|
// $string = 'jsapi_ticket='.$jsapiTicket.'&noncestr='.$nonceStr.'×tamp='.$timestamp.'&url='.$url;
|
|
|
// $signature = sha1($string);
|
|
|
// $data = [
|
|
|
// "appId" => $this->appkey2,
|
|
|
// "nonceStr" => $nonceStr,
|
|
|
// "timestamp" => $timestamp,
|
|
|
// "url" => $url,
|
|
|
// "signature" => $signature,
|
|
|
// "rawString" => $string
|
|
|
// ];
|
|
|
// $this->assign('data',$data);
|
|
|
$jsapiTicket = $this->getSignature();
|
|
|
// 注意 URL 一定要动态获取,不能 hardcode.
|
|
|
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
|
|
if($url === '') {
|
|
|
$url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
|
|
}
|
|
|
$timestamp = time();
|
|
|
$nonceStr = $this->createNonceStr();
|
|
|
$string = 'jsapi_ticket='.$jsapiTicket.'&noncestr='.$nonceStr.'×tamp='.$timestamp.'&url='.$url;
|
|
|
$signature = sha1($string);
|
|
|
$data = [
|
|
|
"appId" => $this->appkey2,
|
|
|
"nonceStr" => $nonceStr,
|
|
|
"timestamp" => $timestamp,
|
|
|
"url" => $url,
|
|
|
"signature" => $signature,
|
|
|
"rawString" => $string
|
|
|
];
|
|
|
$this->assign('data',$data);
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
...
|
...
|
|