Skip to content

Commit 8fc4743

Browse files
committed
优化 expires 参数
1 parent f5a70f3 commit 8fc4743

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdk/util.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ var getAuth = function (opt) {
4646
var now = parseInt(new Date().getTime() / 1000) - 1;
4747
var expired = now; // now + ';' + (now + 60) + ''; // 签名过期时间为当前 + 3600s
4848

49-
if (opt.expires) {
50-
expired += (opt.expires * 1);
51-
} else {
49+
if (opt.expires === undefined) {
5250
expired += 3600;
51+
} else {
52+
expired += (opt.expires * 1) || 0;
5353
}
5454

5555
// 要用到的 Authorization 参数列表

0 commit comments

Comments
 (0)