Beispiel #1
0
 public function authinfo()
 {
     global $_M;
     $query = "SELECT * FROM {$_M['table']['otherinfo']} WHERE id='1'";
     $key_info = DB::get_one($query);
     $curl = load::sys_class('curl', 'new');
     $curl->set('file', "index.php?n=platform&c=authcheck&m=web&a=doauth_json&key={$key_info['authpass']}&code={$key_info['authcode']}&domain={$_M['url']['site']}&datatype=data&weblang=cn");
     $post = array('post' => '');
     $info = $curl->curl_post($post);
     $re = jsondecode($info);
     $query = "update {$_M['table']['otherinfo']} set info1='{$re['webtype_h']}' where id=1";
     DB::query($query);
     return $re;
 }
Beispiel #2
0
 public function get_info_by_curl($unionid)
 {
     global $_M;
     $data = $this->get_other_user($unionid);
     $url = "https://api.weixin.qq.com/sns/userinfo";
     $send['access_token'] = $data['access_token'];
     $send['openid'] = $data['openid'];
     $data = jsondecode(load::mod_class('user/class/curl_ssl', 'new')->curl_post($url, $send, 'get'));
     $data['username'] = $data['nickname'];
     if ($this->error_curl($data)) {
         return false;
     } else {
         return $data;
     }
 }
Beispiel #3
0
 public function get_info_by_curl($unionid)
 {
     global $_M;
     $data = $this->get_other_user($unionid);
     $url = "https://api.weibo.com/2/users/show.json";
     $send['access_token'] = $data['access_token'];
     $send['uid'] = $data['openid'];
     $send['source'] = $this->appkey;
     $data = jsondecode(load::mod_class('user/class/curl_ssl', 'new')->curl_post($url, $send, 'get'));
     $data['username'] = $data['screen_name'];
     if ($this->error_curl($data)) {
         return false;
     } else {
         return $data;
     }
 }