Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Aug 14, 2018
1 parent 688ca30 commit 2a875e8
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,26 +305,24 @@ function putBucketPolicy() {
cos.putBucketPolicy({
Policy: {
"version": "2.0",
"principal": {"qcs": ["qcs::cam::uin/10001:uin/10001"]}, // 这里的 10001 是 QQ 号
"statement": [
{
"effect": "allow",
"action": [
"name/cos:GetBucket",
"name/cos:PutObject",
"name/cos:PostObject",
"name/cos:PutObjectCopy",
"name/cos:InitiateMultipartUpload",
"name/cos:UploadPart",
"name/cos:UploadPartCopy",
"name/cos:CompleteMultipartUpload",
"name/cos:AbortMultipartUpload",
"name/cos:AppendObject"
],
// "resource": ["qcs::cos:ap-guangzhou:uid/1250000000:test-1250000000/*"] // 1250000000 是 appid
"resource": ["qcs::cos:" + config.Region + ":uid/" + AppId + ":" + config.Bucket + "/*"] // 1250000000 是 appid
}
]
"statement": [{
"effect": "allow",
"principal": {"qcs": ["qcs::cam::uin/10001:uin/10001"]}, // 这里的 10001 是 QQ 号
"action": [
"name/cos:GetBucket",
"name/cos:PutObject",
"name/cos:PostObject",
"name/cos:PutObjectCopy",
"name/cos:InitiateMultipartUpload",
"name/cos:UploadPart",
"name/cos:UploadPartCopy",
"name/cos:CompleteMultipartUpload",
"name/cos:AbortMultipartUpload",
"name/cos:AppendObject"
],
// "resource": ["qcs::cos:ap-guangzhou:uid/1250000000:test-1250000000/*"] // 1250000000 是 appid
"resource": ["qcs::cos:" + config.Region + ":uid/" + AppId + ":" + config.Bucket + "/*"] // 1250000000 是 appid
}]
},
Bucket: config.Bucket, // Bucket 格式:test-1250000000
Region: config.Region
Expand Down

0 comments on commit 2a875e8

Please sign in to comment.