File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ var ReactQiniuDemo = React.createClass({
20
20
return {
21
21
files: [],
22
22
token: ' YOUR_UPLOAD_TOKEN' ,
23
+ uploadKey: ' YOUR_CUSTOM_UPLOAD_KEY' , // Optional
23
24
prefix: ' YOUR_QINIU_KEY_PREFIX' // Optional
24
25
};
25
26
},
@@ -49,7 +50,7 @@ var ReactQiniuDemo = React.createClass({
49
50
render : function () {
50
51
return (
51
52
< div>
52
- < Qiniu onDrop= {this .onDrop } size= {150 } token= {this .state .token } onUpload= {this .onUpload }>
53
+ < Qiniu onDrop= {this .onDrop } size= {150 } token= {this .state .token } uploadKey = { this . state . uploadKey } onUpload= {this .onUpload }>
53
54
< div> Try dropping some files here, or click to select files to upload.< / div>
54
55
< / Qiniu>
55
56
< / div>
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ var ReactQiniu = React.createClass({
24
24
multiple : React . PropTypes . bool ,
25
25
// Qiniu
26
26
uploadUrl : React . PropTypes . string ,
27
+ uploadKey : React . PropTypes . string ,
27
28
prefix : React . PropTypes . string
28
29
} ,
29
30
@@ -107,6 +108,11 @@ var ReactQiniu = React.createClass({
107
108
if ( this . props . prefix ) {
108
109
key = this . props . prefix + key ;
109
110
}
111
+
112
+ if ( this . props . uploadKey ) {
113
+ key = this . props . uploadKey ;
114
+ }
115
+
110
116
var r = request
111
117
. post ( this . props . uploadUrl )
112
118
. field ( 'key' , key )
You can’t perform that action at this time.
0 commit comments