Skip to content

Commit 5f216e9

Browse files
committed
x_vars can not set to be a object
1 parent d0b79fc commit 5f216e9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ qiniu-js-sdk
7777
// 'time' : function(up,file) {
7878
// var time = (new Date()).getTime();
7979
// do something with 'time'
80-
// returnt time;
80+
// return time;
8181
// },
8282
// 'size' : function(up,file) {
8383
// var size = file.size;

demo/js/qiniu.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function QiniuJsSDK() {
350350
if (x_vars.hasOwnProperty(x_key)) {
351351
if (typeof x_vars[x_key] === 'function') {
352352
multipart_params_obj['x:' + x_key] = x_vars[x_key](up, file);
353-
} else if (typeof x_vars[x_key] === 'string') {
353+
} else if (typeof x_vars[x_key] !== 'object') {
354354
multipart_params_obj['x:' + x_key] = x_vars[x_key];
355355
}
356356
}
@@ -507,7 +507,7 @@ function QiniuJsSDK() {
507507
if (x_vars.hasOwnProperty(x_key)) {
508508
if (typeof x_vars[x_key] === 'function') {
509509
x_val = that.URLSafeBase64Encode(x_vars[x_key](up, file));
510-
} else if (typeof x_vars[x_key] === 'string') {
510+
} else if (typeof x_vars[x_key] !== 'object') {
511511
x_val = that.URLSafeBase64Encode(x_vars[x_key]);
512512
}
513513
x_vars_url += '/x:' + x_key + '/' + x_val;
@@ -525,6 +525,7 @@ function QiniuJsSDK() {
525525
if (ajax.readyState === 4) {
526526
if (ajax.status === 200) {
527527
var info = ajax.responseText;
528+
528529
if (FileUploaded_Handler) {
529530
FileUploaded_Handler(up, file, info);
530531
}

src/qiniu.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function QiniuJsSDK() {
350350
if (x_vars.hasOwnProperty(x_key)) {
351351
if (typeof x_vars[x_key] === 'function') {
352352
multipart_params_obj['x:' + x_key] = x_vars[x_key](up, file);
353-
} else if (typeof x_vars[x_key] === 'string') {
353+
} else if (typeof x_vars[x_key] !== 'object') {
354354
multipart_params_obj['x:' + x_key] = x_vars[x_key];
355355
}
356356
}
@@ -507,7 +507,7 @@ function QiniuJsSDK() {
507507
if (x_vars.hasOwnProperty(x_key)) {
508508
if (typeof x_vars[x_key] === 'function') {
509509
x_val = that.URLSafeBase64Encode(x_vars[x_key](up, file));
510-
} else if (typeof x_vars[x_key] === 'string') {
510+
} else if (typeof x_vars[x_key] !== 'object') {
511511
x_val = that.URLSafeBase64Encode(x_vars[x_key]);
512512
}
513513
x_vars_url += '/x:' + x_key + '/' + x_val;
@@ -525,6 +525,7 @@ function QiniuJsSDK() {
525525
if (ajax.readyState === 4) {
526526
if (ajax.status === 200) {
527527
var info = ajax.responseText;
528+
528529
if (FileUploaded_Handler) {
529530
FileUploaded_Handler(up, file, info);
530531
}

0 commit comments

Comments
 (0)