|
|
|
@ -4,7 +4,7 @@ import { FileAddOutlined } from '@ant-design/icons';
|
|
|
|
|
import { v4 as uuid } from 'uuid';
|
|
|
|
|
import { API_HOST } from '@/config';
|
|
|
|
|
import { whatsappSupportFileTypes } from '@/channel/whatsappUtils';
|
|
|
|
|
import { isEmpty, } from '@/utils/commons';
|
|
|
|
|
import { isEmpty, sanitizeFilename } from '@/utils/commons';
|
|
|
|
|
// import useConversationStore from '@/stores/ConversationStore';
|
|
|
|
|
|
|
|
|
|
const aliOSSHost = `https://haina-sale-system.oss-cn-shenzhen.aliyuncs.com/WAMedia/`;
|
|
|
|
@ -33,7 +33,7 @@ const ImageUpload = ({ disabled, invokeUploadFileMessage, invokeSendUploadMessag
|
|
|
|
|
const lastDotIndex = file.name.lastIndexOf('.');
|
|
|
|
|
const suffix = file.name.slice(lastDotIndex+1);
|
|
|
|
|
const baseName = file.name.slice(0, lastDotIndex);
|
|
|
|
|
const rename = baseName + '-' + Date.now() + '.' + suffix;
|
|
|
|
|
const rename = sanitizeFilename(baseName) + '-' + Date.now() + '.' + suffix;
|
|
|
|
|
const dataUri = aliOSSHost + rename;
|
|
|
|
|
// 读取完毕后获取结果
|
|
|
|
|
reader.onload = (event) => {
|
|
|
|
|