Skip to content

Commit 6bdd492

Browse files
committed
no need encodeURIComponent
1 parent 33aca0d commit 6bdd492

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,25 @@ js-sdk-v4 for [腾讯云对象存储服务](http://wiki.qcloud.com/wiki/COS%E4%B
5050
/**
5151
$.ajax('SIGN_URL').done(function (data) {
5252
var sig = data.sign;
53-
callback(encodeURIComponent(sig));
53+
callback(sig);
5454
});
5555
**/
5656

5757
//2.直接在浏览器前端计算签名,需要获取自己的accessKey和secretKey, 一般在调试阶段使用
5858
//拿到签名之后记得调用callback
5959
//var res = getAuth(); //这个函数自己根据签名算法实现
60-
//callback(encodeURIComponent(res));
60+
//callback(res);
6161

6262

6363
//3.直接复用别人算好的签名字符串, 一般在调试阶段使用
6464
//拿到签名之后记得调用callback
65-
//callback(encodeURIComponent('YOUR_SIGN_STR'))
65+
//callback('YOUR_SIGN_STR')
6666
//
6767

6868
},
6969
getAppSignOnce: function (callback) {//单次签名,必填参数,参考上面的注释即可
7070
//填上获取单次签名的逻辑
71-
// callback(encodeURIComponent('YOUR_SIGN_STR'))
71+
// callback('YOUR_SIGN_STR')
7272
}
7373
});
7474

sample/demo/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
/**
4343
$.ajax('SIGN_URL').done(function (data) {
4444
var sig = data.sign;
45-
callback(encodeURIComponent(sig));
45+
callback(sig);
4646
});
4747
**/
4848

@@ -62,12 +62,12 @@
6262
var res = resWordArray.toString(CryptoJS.enc.Base64);
6363

6464
setTimeout(function () {//setTimeout模拟一下网络延迟的情况
65-
callback(encodeURIComponent(res));
65+
callback(res);
6666
}, 1000);
6767

6868

6969
//3.直接复用别人算好的签名字符串, 一般在调试阶段使用
70-
//callback(encodeURIComponent('YOUR_SIGN_STR'))
70+
//callback('YOUR_SIGN_STR')
7171

7272

7373
},
@@ -86,7 +86,7 @@
8686
var res = resWordArray.toString(CryptoJS.enc.Base64);
8787

8888
setTimeout(function () {//setTimeout模拟一下网络延迟的情况
89-
callback(encodeURIComponent(res));
89+
callback(res);
9090
}, 1000);
9191
}
9292
});

0 commit comments

Comments
 (0)