Skip to content

Commit

Permalink
公众号支付
Browse files Browse the repository at this point in the history
兼容nginx
  • Loading branch information
dedemao authored Nov 27, 2018
1 parent f2cb042 commit 2eefdd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jsapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public function GetOpenid()
if (!isset($_GET['code'])){
//触发微信返回code码
$scheme = $_SERVER['HTTPS']=='on' ? 'https://' : 'http://';
$baseUrl = urlencode($scheme.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$_SERVER['QUERY_STRING']);
$uri = $_SERVER['PHP_SELF'].$_SERVER['QUERY_STRING'];
if($_SERVER['REQUEST_URI']) $uri = $_SERVER['REQUEST_URI'];
$baseUrl = urlencode($scheme.$_SERVER['HTTP_HOST'].$uri);
$url = $this->__CreateOauthUrlForCode($baseUrl);
Header("Location: $url");
exit();
Expand Down

0 comments on commit 2eefdd7

Please sign in to comment.