Skip to content

Commit 0d3c285

Browse files
committed
Update uploadUrl based on protocol
1 parent 766cf9e commit 0d3c285

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ var ReactQiniu = React.createClass({
2929
},
3030

3131
getDefaultProps: function() {
32+
if (window.location.protocol === 'https:') {
33+
uploadUrl = 'https://up.qbox.me/'
34+
} else {
35+
uploadUrl = 'http://upload.qiniu.com'
36+
}
37+
3238
return {
3339
supportClick: true,
3440
multiple: true,
35-
uploadUrl: 'https://up.qbox.me/'
41+
uploadUrl: uploadUrl
3642
};
3743
},
3844

0 commit comments

Comments
 (0)