GET——token

private function get_token(){
$appid="wx4dae5d61b7f9935c";
$appSecret="24a91315a1a62a9efe323accf5c93839";
$token=session('token') ;

if($token){

$WechatAuth=new WechatAuth($appid,$appSecret,$token);

}else{
$WechatAuth=new WechatAuth($appid,$appSecret);

$accsseToken=$WechatAuth->getAccessToken();
$token=$accsseToken['access_token'];
session('token',$token);
}
return $token;
}

你可能感兴趣的:(GET——token)