Skip to content

Commit

Permalink
update csp doc
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Oct 29, 2018
1 parent 3f8dccd commit d107ab1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions csp/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

对象存储服务的 XML JS SDK 资源 github 地址:[tencentyun/cos-js-sdk-v5](https://github.com/tencentyun/cos-js-sdk-v5)

演示示例 Demo 下载地址[XML JS SDK CSP Demo](https://github.com/tencentyun/cos-js-sdk-v5/tree/master/csp/csp.html)
演示示例 Demo 代码地址[XML JS SDK CSP Demo](https://github.com/tencentyun/cos-js-sdk-v5/tree/master/csp/csp.html)

### 开发准备

Expand Down Expand Up @@ -41,13 +41,14 @@ var cos = new COS({
ServiceDomain: 'http://cos.default.xxx.com', // 这里替换成 getService 域名
Domain: 'http://{Bucket}.cos.{Region}.xxx.com', 这里替换成 API 域名格式模板
getAuthorization: function (options, callback) {
$.get('./auth.php', {
method: options.Method,
pathname: options.Key,
}, function (auth) {
callback(auth);
});
}
var url = './auth.php?method=' + options.Method + '&pathname=' + encodeURIComponent(options.Key);
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onload = function (e) {
callback(e.target.responseText);
};
xhr.send();
},
});
// 监听选文件
Expand Down

0 comments on commit d107ab1

Please sign in to comment.