Ejemplo n.º 1
0
 function login($uemail, $upass)
 {
     $url = 'https://mp.weixin.qq.com/cgi-bin/login?lang=zh_CN';
     $send_data = array('username' => $uemail, 'pwd' => md5($upass), 'f' => 'json');
     $httpClient = new HttpUtil();
     $httpClient->referer = "https://mp.weixin.qq.com/cgi-bin/loginpage?t=wxm2-login&lang=zh_CN";
     $httpClient->getHeader = "0";
     $result = $httpClient->PostContent($url, $send_data);
     $bar = json_decode($result);
     if ($bar->base_resp->ret == 0) {
         $this->token = explode('=', explode('&', $bar->redirect_url)[2])[1];
     } else {
         die("登陆失败" . $bar->base_resp->err_msg);
     }
 }