话不多说 直接上代码
public function to_invite(){
$user_id = $this->request->post("user_id");
$public_path = ROOT_PATH . "public";
$file_name = "/uploads/applet_qrcode/" . $user_id . '.jpg';
if( !file_exists($public_path . $file_name) ){
$appid = config('apple.AppID');
$appSecret = config('apple.AppSecret');
$access_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={
$appid}&secret={
$appSecret}";
$access_token = file_get_contents