__construct(); } function index_f() { $appid = ''; if($this->sys_config[Appid]&&strlen($this->sys_config[Appid])>1){ $appid=$this->sys_config[Appid]; }else if($this->STCModel->Appid) { $appid=$this->STCModel->Appid; } $_SESSION["appid"]=$appid; $serverPort=$_SERVER["SERVER_PORT"]; $retUrl="http://".$_SERVER['SERVER_NAME']; /*if($serverPort==80){ $retUrl.=$_SERVER["REQUEST_URI"]; }else{ $retUrl.=':'.$serverPort.$_SERVER["REQUEST_URI"]; }*/ $retUrl.=$_SERVER["REQUEST_URI"]; $retUrl=str_replace('wxlogin',"oauth",$retUrl); //$retUrl=str_replace('index.php?c=wxlogin',"oauth.php",$retUrl); $retUrl='location:https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appid.'&redirect_uri='.$retUrl.'&response_type=code&scope=snsapi_userinfo&state=123&connect_redirect=1#wechat_redirect'; //print_r($retUrl); header($retUrl); //header('location:https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appid.'&redirect_uri='.$retUrl.'&response_type=code&scope=snsapi_userinfo&state=123&connect_redirect=1#wechat_redirect'); //print_r($retUrl); //print_r($_SERVER["HTTP_REFERER"].$this->tpl->_sys[siteurl].HOME_PAGE."?c=home&ruid=11"); } } ?>