Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhua committed Feb 2, 2016
1 parent cc57bb6 commit 1b38587
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ <h4>分块上传</h4>
</code></pre>
<p>在完成上传的步骤中,参数中需要带上上传区块的清单时需要每个分块上传成功时的ETag,为了能正确地接收BOS服务器返回的这个字段,您需要在相关bucket的cors设置中,在ExposeHeaders中添加“ETag”,如下图所示。</p>
<p class="text-center">
<img src="http://bos.bj.baidubce.com/v1/bce-javascript-sdk-demo-test/示例图.png" alt="">
<img src="http://bos.bj.baidubce.com/v1/bce-javascript-sdk-demo-test/示例图.png" alt=""
style="max-width: 80%;">
</p>
<p>您可以在开放云控制台中查看由于分块上传而产生的文件分块信息:</p>
<ol>
Expand Down
16 changes: 9 additions & 7 deletions demo/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,17 @@ $(document).ready(function() {
}
})
.catch(function(err) {
toastr.success('上传失败');
toastr.error('上传失败');
console.error(err);
});

$row.on('click', '.showEdit', function(e) {
window.client = client;
$('#edit').modal();
var key = $(e.target).attr('data-key');
updateImage(client.generateUrl(bucket, key));
$('#process').attr('data-key', key);
});
})(evt);
});

Expand Down Expand Up @@ -204,12 +212,6 @@ $(document).ready(function() {
return num.toFixed(1) + unit[index];
}

$fileList.on('click', '.showEdit', function(e) {
$('#edit').modal();
var key = $(e.target).attr('data-key');
updateImage(client.generateUrl(bucket, key));
$('#process').attr('data-key', key);
});

function getTasks(file, uploadId, bucketName, key) {
var leftSize = file.size;
Expand Down

0 comments on commit 1b38587

Please sign in to comment.