File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ class Crop extends File
28
28
29
29
protected function preview ()
30
30
{
31
- return $ this ->objectUrl ($ this ->value ());
31
+ if (!is_null ($ this ->value ()))
32
+ return $ this ->objectUrl ($ this ->value ());
32
33
}
33
34
34
35
/**
@@ -69,7 +70,7 @@ public function prepare($base64)
69
70
} else if (preg_match ('/data:image\/.*?;base64/is ' ,$ base64 )) {
70
71
//检查是否是base64编码
71
72
//base64转图片缓存 返回的是绝对路径
72
- $ image = $ this ->base64_image_content ($ base64 ,public_path ( ' uploads /base64img_cache ' ));
73
+ $ image = $ this ->base64_image_content ($ base64 ,storage_path ( ' app/public/images /base64img_cache ' ));
73
74
if ($ image !== false ) {
74
75
$ image = new UploadedFile ($ image ['path ' ],$ image ['filename ' ]);
75
76
$ this ->name = $ this ->getStoreName ($ image );
You can’t perform that action at this time.
0 commit comments