作者 macbook

海报

@@ -605,12 +605,13 @@ class User extends Base @@ -605,12 +605,13 @@ class User extends Base
605 // 用户小程序码 605 // 用户小程序码
606 $qrcode = $dir.'/qrcode_'.$user['id'].'.png'; 606 $qrcode = $dir.'/qrcode_'.$user['id'].'.png';
607 if(!file_exists($qrcode)){ 607 if(!file_exists($qrcode)){
608 - $response = (new Wechat('wxMiniProgram'))->app_code->getUnlimit($user['id'], [ 608 + $wechat = new Wechat('wxMiniProgram');
  609 + $response = $wechat->getApp()->app_code->getUnlimit($user['id'], [
609 'page' => 'pages/indexone/indexone', 610 'page' => 'pages/indexone/indexone',
610 'width' => 280, //最小宽度280 611 'width' => 280, //最小宽度280
611 ]); 612 ]);
612 if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) { 613 if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
613 - $response->saveAs($dir, str_replace($dir.'/','',$qrcode)); 614 + $response->save($qrcode);
614 } 615 }
615 // 280不满足,再缩小 616 // 280不满足,再缩小
616 \think\Image::open($qrcode)->thumb(64,64)->save($qrcode); 617 \think\Image::open($qrcode)->thumb(64,64)->save($qrcode);