weiwait / dcat-cropper Goto Github PK
View Code? Open in Web Editor NEWdcat-admin 图片裁剪
dcat-admin 图片裁剪
您好,請問我要刪除上傳後的圖,從剪裁視窗是可以透過刪除按鈕來刪除預覽圖,可是送出後該圖片仍然存在,完全無法刪除,這可以怎麼解決呢?
可以在prepareInputValue方法最前面加入判断value空返回解决问题
在CroppingController文件中,有这么一句
$filename = Storage::disk(config('admin.upload.disk'))->putFile('weiwait/cropper', $request->file('file'));
然后上传云存储,
在 Cropping.php中
} elseif (str_starts_with($file, 'weiwait/cropper')) { $storage = Storage::disk(config('admin.upload.disk')); $cached = $storage->get($file); //...... }
文件提示找不到,只好把整段ELSE删除。
看这段 else 是上传 weiwait 的临时文件然后删除吗? 那为何不直接在 controller 中
$filename = Storage::disk(config('admin.upload.disk'))->putFile(config('admin.upload.directory.image'), $request->file('file'));
composer require weiwait/dcat-cropper
php artisan vendor:publish --tag=weiwait.dcat-cropper --force
php artisan admin:ide-helper
全部执行完毕后,页面显示
Field type [cropper] does not exist.
vendor\weiwait\dcat-cropper\src\Form\Field\Cropper.php
的 prepareInputValue 方法中
$this->callInterventionMethods($this->getStorage()->path($file), $this->getStorage()->mimeType($file));
修改为
$this->callInterventionMethods($this->getStorage()->path($file), null);
正常。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.