...
|
...
|
@@ -122,8 +122,11 @@ class Share extends WechatBase |
|
|
if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $img_content, $result)) {
|
|
|
$type = $result[2];
|
|
|
$new_file = $save_dir.$filename.'.'.$type;
|
|
|
$save_path= 'uploads/avatar/'.$filename.'.'.$type;
|
|
|
$save_path= './uploads/avatar/'.$filename.'.'.$type;
|
|
|
if (file_put_contents($new_file, base64_decode(str_replace($result[1], '', $img_content)))) {
|
|
|
//等比放大缩小二维码
|
|
|
$image = \think\Image::open($save_path);
|
|
|
$image->thumb(88, 90,\think\Image::THUMB_SCALING)->save($save_path);
|
|
|
return ['code'=>0,'file_path'=>$new_file,'save_path'=>$save_path];
|
|
|
}else{
|
|
|
return ['code'=>1,'msg'=>'图片保存失败'];
|
...
|
...
|
|