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