atr-components 0.2.234 → 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.
@@ -394,7 +394,7 @@ class ToolsUtil {
394
394
  if (url.startsWith("http")) {
395
395
  return url;
396
396
  }
397
- return atr_static_datas.OSS_URL + url;
397
+ return atr_static_datas.OSS_URL + url + "?v=" + new Date().getTime();
398
398
  }
399
399
  static getStaticOssUrl(url) {
400
400
  if (!url) {
@@ -403,7 +403,8 @@ class ToolsUtil {
403
403
  if (url.startsWith("http")) {
404
404
  return url;
405
405
  }
406
- return atr_static_datas.STATIC_OSS_URL + url + "?v=" + new Date().getTime();
406
+ let v = new Date().getTime();
407
+ return atr_static_datas.STATIC_OSS_URL + url + "?v=" + v;
407
408
  }
408
409
  static removeHtml(value) {
409
410
  if (!value) {
@@ -2001,7 +2002,7 @@ class UploadOssService {
2001
2002
  const success = (result) => {
2002
2003
  if (result.status === 200) {
2003
2004
  this.uploadData = result.data;
2004
- this.customReq(file, fullUrl).subscribe((url) => {
2005
+ this.customReq(file, fullUrl, result.data).subscribe((url) => {
2005
2006
  observe.next(url);
2006
2007
  observe.unsubscribe();
2007
2008
  });
@@ -2022,9 +2023,10 @@ class UploadOssService {
2022
2023
  }, ToolsUtil.getHttpOptions()).subscribe(success, error);
2023
2024
  });
2024
2025
  };
2025
- this.customReq = (file, fullUrl = true) => {
2026
+ this.customReq = (file, fullUrl = true, uploadData = null) => {
2026
2027
  const formData = new FormData();
2027
- for (let key in this.uploadData) {
2028
+ uploadData = uploadData ? uploadData : this.uploadData;
2029
+ for (let key in uploadData) {
2028
2030
  if (key != 'host')
2029
2031
  formData.append(key, this.uploadData[key]);
2030
2032
  }
@@ -2037,7 +2039,7 @@ class UploadOssService {
2037
2039
  if (event.type === HttpEventType.UploadProgress) {
2038
2040
  }
2039
2041
  else if (event instanceof HttpResponse) {
2040
- const url = fullUrl ? (event.url + this.uploadData.key) : this.uploadData.key;
2042
+ const url = fullUrl ? (event.url + uploadData.key) : uploadData.key;
2041
2043
  observe.next(url);
2042
2044
  observe.unsubscribe();
2043
2045
  }