meixioacomponent 1.1.58 → 1.1.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/packages/utils/upload.js
CHANGED
|
@@ -2,6 +2,7 @@ import axios from "axios";
|
|
|
2
2
|
import uploadRequest from "../config/uploadRequest";
|
|
3
3
|
import componentConfig from "../config/componentConfig";
|
|
4
4
|
import { v4 } from "uuid";
|
|
5
|
+
import {fileSuffix} from "./utils";
|
|
5
6
|
|
|
6
7
|
// state 0是未开始 1是已完成 2是以失败
|
|
7
8
|
class Upload {
|
|
@@ -22,7 +23,7 @@ class Upload {
|
|
|
22
23
|
if (isOss) {
|
|
23
24
|
try {
|
|
24
25
|
const v4Id = v4();
|
|
25
|
-
const fileName = `${v4Id}
|
|
26
|
+
const fileName = `${v4Id}.${fileSuffix(this.file.name)}`;
|
|
26
27
|
let { accessKeyId, signature, host, policy, dir } =
|
|
27
28
|
await this.getOssParams();
|
|
28
29
|
params.append("OSSAccessKeyId", `${accessKeyId}`);
|