Skip to content

Commit 61920a6

Browse files
committed
修改解析token中的scope
1 parent 3f35a49 commit 61920a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

qiniu/zone.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ exports.up_host = function (uptoken, conf){
1919
var tokenPolicy = uptoken.toString().split(":")[2];
2020
var tokenPolicyStr = new Buffer(tokenPolicy, 'base64').toString();
2121
var json_tokenPolicyStr = JSON.parse(tokenPolicyStr);
22-
var bucket = json_tokenPolicyStr.scope;
22+
23+
var scope = json_tokenPolicyStr.scope;
24+
var bucket = scope.toString().split(":")[0];
2325

2426
// bucket 相同,上传域名仍在过期时间内
2527
if((new Date().getTime() < conf.EXPIRE) && bucket == conf.BUCKET){

0 commit comments

Comments
 (0)