OSS上传
import { Upload, Button, Icon } from ‘@alifd/next’;
<Form.Item label=“操作说明图片”>
</Form.Item>
// 图片上传
const beforeUpload = (file, options) => {
if (file.size > 2048000) {
Message.error(‘文件不能大于2M’);
return false;
}
return new Promise((resolve, reject) => {
setTimeout(() => {
getUpload().then((res) => {
const g_object_key = res?.dir + getKey();
options.data = {
// host: res?.host,
OSSAccessKeyId: res?.accessId,
policy: res?.policy,
signature: res?.signature,
expire: res?.expire,
success_action_status: 200,
key: g_object_key,
};
options.headers = { 'X-Requested-With': null };
options.action = res?.host;
file.tempUrl = `${res?.host}/${g