|
@@ -523,25 +523,25 @@ class LoginController extends HomeBaseController |
|
@@ -523,25 +523,25 @@ class LoginController extends HomeBaseController |
523
|
|
523
|
|
524
|
//获取微信分享配置信息
|
524
|
//获取微信分享配置信息
|
525
|
public function wxShare($url=''){
|
525
|
public function wxShare($url=''){
|
526
|
-// $jsapiTicket = $this->getSignature();
|
|
|
527
|
-// // 注意 URL 一定要动态获取,不能 hardcode.
|
|
|
528
|
-// $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
|
|
529
|
-// if($url === '') {
|
|
|
530
|
-// $url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
|
|
531
|
-// }
|
|
|
532
|
-// $timestamp = time();
|
|
|
533
|
-// $nonceStr = $this->createNonceStr();
|
|
|
534
|
-// $string = 'jsapi_ticket='.$jsapiTicket.'&noncestr='.$nonceStr.'×tamp='.$timestamp.'&url='.$url;
|
|
|
535
|
-// $signature = sha1($string);
|
|
|
536
|
-// $data = [
|
|
|
537
|
-// "appId" => $this->appkey2,
|
|
|
538
|
-// "nonceStr" => $nonceStr,
|
|
|
539
|
-// "timestamp" => $timestamp,
|
|
|
540
|
-// "url" => $url,
|
|
|
541
|
-// "signature" => $signature,
|
|
|
542
|
-// "rawString" => $string
|
|
|
543
|
-// ];
|
|
|
544
|
-// $this->assign('data',$data);
|
526
|
+ $jsapiTicket = $this->getSignature();
|
|
|
527
|
+ // 注意 URL 一定要动态获取,不能 hardcode.
|
|
|
528
|
+ $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
|
|
529
|
+ if($url === '') {
|
|
|
530
|
+ $url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
|
|
531
|
+ }
|
|
|
532
|
+ $timestamp = time();
|
|
|
533
|
+ $nonceStr = $this->createNonceStr();
|
|
|
534
|
+ $string = 'jsapi_ticket='.$jsapiTicket.'&noncestr='.$nonceStr.'×tamp='.$timestamp.'&url='.$url;
|
|
|
535
|
+ $signature = sha1($string);
|
|
|
536
|
+ $data = [
|
|
|
537
|
+ "appId" => $this->appkey2,
|
|
|
538
|
+ "nonceStr" => $nonceStr,
|
|
|
539
|
+ "timestamp" => $timestamp,
|
|
|
540
|
+ "url" => $url,
|
|
|
541
|
+ "signature" => $signature,
|
|
|
542
|
+ "rawString" => $string
|
|
|
543
|
+ ];
|
|
|
544
|
+ $this->assign('data',$data);
|
545
|
return $this->fetch();
|
545
|
return $this->fetch();
|
546
|
}
|
546
|
}
|
547
|
|
547
|
|