atr-components 0.2.235 → 0.2.236
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/core/services/upload-oss.service.d.ts +1 -1
- package/esm2020/core/services/upload-oss.service.mjs +6 -5
- package/fesm2015/atr-components.mjs +5 -4
- package/fesm2015/atr-components.mjs.map +1 -1
- package/fesm2020/atr-components.mjs +5 -4
- package/fesm2020/atr-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2002,7 +2002,7 @@ class UploadOssService {
|
|
|
2002
2002
|
const success = (result) => {
|
|
2003
2003
|
if (result.status === 200) {
|
|
2004
2004
|
this.uploadData = result.data;
|
|
2005
|
-
this.customReq(file, fullUrl).subscribe((url) => {
|
|
2005
|
+
this.customReq(file, fullUrl, result.data).subscribe((url) => {
|
|
2006
2006
|
observe.next(url);
|
|
2007
2007
|
observe.unsubscribe();
|
|
2008
2008
|
});
|
|
@@ -2023,9 +2023,10 @@ class UploadOssService {
|
|
|
2023
2023
|
}, ToolsUtil.getHttpOptions()).subscribe(success, error);
|
|
2024
2024
|
});
|
|
2025
2025
|
};
|
|
2026
|
-
this.customReq = (file, fullUrl = true) => {
|
|
2026
|
+
this.customReq = (file, fullUrl = true, uploadData = null) => {
|
|
2027
2027
|
const formData = new FormData();
|
|
2028
|
-
|
|
2028
|
+
uploadData = uploadData ? uploadData : this.uploadData;
|
|
2029
|
+
for (let key in uploadData) {
|
|
2029
2030
|
if (key != 'host')
|
|
2030
2031
|
formData.append(key, this.uploadData[key]);
|
|
2031
2032
|
}
|
|
@@ -2038,7 +2039,7 @@ class UploadOssService {
|
|
|
2038
2039
|
if (event.type === HttpEventType.UploadProgress) {
|
|
2039
2040
|
}
|
|
2040
2041
|
else if (event instanceof HttpResponse) {
|
|
2041
|
-
const url = fullUrl ? (event.url +
|
|
2042
|
+
const url = fullUrl ? (event.url + uploadData.key) : uploadData.key;
|
|
2042
2043
|
observe.next(url);
|
|
2043
2044
|
observe.unsubscribe();
|
|
2044
2045
|
}
|