|
|
|
@ -18,6 +18,10 @@ import { useEmailDetail } from '@/hooks/useEmail';
|
|
|
|
|
import useSnippetStore from '@/stores/SnippetStore'
|
|
|
|
|
import { useOrderStore } from '@/stores/OrderStore'
|
|
|
|
|
|
|
|
|
|
// 禁止上传的附件类型
|
|
|
|
|
// .application, .exe, .app
|
|
|
|
|
const disallowedAttachmentTypes = ['.ps1','.msi','application/x-msdownload', 'application/x-ms-dos-executable', 'application/x-ms-wmd', 'application/x-ms-wmz', 'application/x-ms-xbap', 'application/x-msaccess', ];
|
|
|
|
|
|
|
|
|
|
const getAbstract = (longtext) => {
|
|
|
|
|
const lines = longtext.split('\n');
|
|
|
|
|
const firstLine = lines[0];
|
|
|
|
@ -244,7 +248,7 @@ const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, toEmail, convers
|
|
|
|
|
setFileList(newFileList);
|
|
|
|
|
};
|
|
|
|
|
const normFile = (e) => {
|
|
|
|
|
console.log('Upload event:', e);
|
|
|
|
|
// console.log('Upload event:', e);
|
|
|
|
|
if (Array.isArray(e)) {
|
|
|
|
|
return e;
|
|
|
|
|
}
|
|
|
|
@ -256,8 +260,16 @@ const EmailEditorPopup = ({ open, setOpen, fromEmail, fromUser, toEmail, convers
|
|
|
|
|
multiple: true,
|
|
|
|
|
fileList,
|
|
|
|
|
beforeUpload: (file) => {
|
|
|
|
|
// console.log('beforeUpload', file);
|
|
|
|
|
const lastDotIndex = file.name.lastIndexOf('.');
|
|
|
|
|
const extension = file.name.slice(lastDotIndex).toLocaleLowerCase();
|
|
|
|
|
if (disallowedAttachmentTypes.includes(file.type) || disallowedAttachmentTypes.includes(extension)) {
|
|
|
|
|
message.warning('不支持的文件格式: '+ extension)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setFileList(prev => [...prev, file]);
|
|
|
|
|
return false;
|
|
|
|
|
return false; // 阻止默认上传, 附件不上传阿里云
|
|
|
|
|
},
|
|
|
|
|
onRemove: (file) => {
|
|
|
|
|
const index = fileList.indexOf(file);
|
|
|
|
|