This commit is contained in:
joyqi 2019-01-10 00:24:38 +08:00
parent 57a5857c1f
commit 8045a0d403

View File

@ -207,7 +207,7 @@ $(document).ready(function () {
// 剪贴板复制图片
textarea.pastableTextarea().on('pasteImage', function (e, data) {
name = data.name.replace(/[\(\)\[\]\*#!]/g, '');
var name = data.name ? data.name.replace(/[\(\)\[\]\*#!]/g, '') : (new Date()).toISOString().replace(/\..+$/, '');
if (!name.match(/\.[a-z0-9]{2,}$/i)) {
var ext = data.blob.type.split('/').pop();
name += '.' + ext;