| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- //换成自己的接口信息
- //$appid = 'wxe30d2c612847beeb';
- //print_r($_sys[siteurl].HOME_PAGE."?c=home&ruid=");
- //header('location:https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appid.'&redirect_uri=http://qmyx.lyfz.net/wzyx/oauth.php&response_type=code&scope=snsapi_userinfo&state=123&connect_redirect=1#wechat_redirect');
- class wxlogin_c extends Control
- {
- function __construct()
- {
- parent::Control();
- }
- function wxlogin_c()
- {
- $this->__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");
- }
-
- }
- ?>
|