授权过程的微软系统编程
6.2微信网页授权实例{ parent::__construct(); $this->config = array_merge($this->config, $custom_config); //设置参数$wx_params = array( 'token' => $this->CI->config->item('app_token'), 'appid' => $this->CI->config->item('app_id'), 'appsecret' => $this->CI->config->item('app_secret'), ); //实例化wechat对象$this->CI->load->library('wechat', $wx_params); } / 微信OAuth2.0授权过程/ function auth(){ log_message('debug', '[wechat_auth] from_url:' . $this->request_url()); //是否已授权$auth_data = $this->CI->session->userdata(KEY_SOCIAL_USER_INFO); if(!empty($auth_data) && !$this->config['get_auth_code_only']){ return; } if(!isset($GET['code'])){ $url = $this->CI->wechat->getOauthRedirect($this->request url(), $this->config['state'], $this->config['auth_scope']); redirect($url); exit; }else if(!$this->config['get_auth_code_only']){ $base_data = $this->CI->wechat->getOauthAccessToken(); if('snsapi_base' === $this->
评论区