Skip to content

Commit a8917b6

Browse files
committed
Merge pull request #83 from meilixie/js-sdk-upload-cancel
when file upload success then ajax a new token
2 parents 7e2379b + 50f1d0c commit a8917b6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

demo/js/main.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,16 @@ $(function() {
5555
},
5656
'FileUploaded': function(up, file, info) {
5757
var progress = new FileProgress(file, 'fsUploadProgress');
58-
progress.setComplete(up, info);
58+
59+
$.ajax('./uptoken',{
60+
async: false
61+
}).done(function(data){
62+
$.extend(info, data);
63+
progress.setComplete(up, info);
64+
}).error(function(){
65+
console.log('获取下载token失败');
66+
});
67+
5968
},
6069
'Error': function(up, err, errTip) {
6170
$('table').show();

0 commit comments

Comments
 (0)