Skip to content

Commit

Permalink
feat:兼容ie promise
Browse files Browse the repository at this point in the history
  • Loading branch information
livehigh committed Jun 21, 2021
1 parent c804b41 commit 97ebf68
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ var apiWrapper = function (apiName, apiFn) {

var errMsg = checkParams();
var isSync = apiName === 'getAuth' || apiName === 'getObjectUrl';
if (Promise && !isSync && !callback) {
if (window.Promise && Promise && !isSync && !callback) {
return new Promise(function (resolve, reject) {
callback = function (err, data) {
err ? reject(err) : resolve(data);
Expand Down Expand Up @@ -2422,7 +2422,7 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '1.2.13';
COS.version = '1.2.14';

module.exports = COS;

Expand Down
2 changes: 1 addition & 1 deletion dist/cos-js-sdk-v5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-js-sdk-v5",
"version": "1.2.13",
"version": "1.2.14",
"description": "JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)",
"main": "index.js",
"types": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/cos.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '1.2.13';
COS.version = '1.2.14';

module.exports = COS;
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ var apiWrapper = function (apiName, apiFn) {

var errMsg = checkParams();
var isSync = apiName === 'getAuth' || apiName === 'getObjectUrl';
if (Promise && !isSync && !callback) {
if (window.Promise && Promise && !isSync && !callback) {
return new Promise(function (resolve, reject) {
callback = function (err, data) {
err ? reject(err) : resolve(data);
Expand Down

0 comments on commit 97ebf68

Please sign in to comment.