if you want to jump to the page before authorization after successful authorization, use header ("Location:". $_ SERVER ["HTTP_REFERER"]) in the successful authorization controller;
find that you can"t get $_ SERVER [" HTTP_REFERER"]
code is as follows: there is a construction method to determine whether you have logged in or not to jump to the authorization page of the web page:
public function wxOauth()
{
var_dump($_SERVER["HTTP_REFERER"]);die();
if(isset($_GET["code"])){
$token=$this->weObj->getOauthAccessToken();
$userinfo=$this->weObj->getOauthUserinfo($token["access_token"],$token["openid"]);
// openid id id id
// $_SERVER["HTTP_REFERER"]
echo $this->rurl;
//header("location:".$this->rurl);
}else{
//$_SERVER["REQUEST_URI"]
$this->rurl=$_SERVER["HTTP_REFERER"];
$host="http://".$_SERVER["HTTP_HOST"].__SELF__;
$url=$this->weObj->getOauthRedirect($host);
header("location:".$url);
}
//
}