Skip to content

Commit

Permalink
1.完善demo
Browse files Browse the repository at this point in the history
  • Loading branch information
shinn-lancelot committed Jul 18, 2018
1 parent 0fe1bf4 commit 99b433b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion demo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
$appsecret = '1429a684d8c8407c684c29f404d4c379';
$scope = 'snsapi_userinfo';
$proxy_scope = '';
$redirect_uri = urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$oldQuaryString = $_SERVER['QUERY_STRING'];
parse_str($oldQuaryString, $quaryStringArr);
$ignoreKey = array('code', 'state', 'access_token', 'openid');
foreach ($quaryStringArr as $key=>$value) {
if (in_array($key, $ignoreKey)) unset($quaryStringArr[$key]);
}
$newQuaryString = http_build_query($quaryStringArr);
$redirect_uri = urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?' . $newQuaryString);
$code = '';
isset($_GET['code']) && $code = $_GET['code'];
$access_token = '';
Expand Down

0 comments on commit 99b433b

Please sign in to comment.