File tree 7 files changed +18
-10
lines changed
7 files changed +18
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -13,5 +13,5 @@ var props = {
13
13
}
14
14
} ;
15
15
16
- React . render ( < Upload { ...props } > 开始上传</ Upload > ,
16
+ React . render ( < Upload { ...props } > < a href = "#nowhere" > 开始上传</ a > </ Upload > ,
17
17
document . getElementById ( '__react-content' ) ) ;
File renamed without changes.
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ var boxStyle = {
13
13
var inputStyle = {
14
14
position : 'absolute' ,
15
15
filter : 'alpha(opacity=0)' ,
16
+ outline : 0 ,
16
17
right : 0 ,
17
18
top : 0 ,
18
19
fontSize : 100
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
var React = require ( 'react' ) ;
3
3
var PropTypes = React . PropTypes ;
4
- var AjaxUpload = require ( './ajaxUploader ' ) ;
5
- var IframeUpload = require ( './iframeUploader ' ) ;
4
+ var AjaxUpload = require ( './AjaxUploader ' ) ;
5
+ var IframeUpload = require ( './IframeUploader ' ) ;
6
6
var empty = function ( ) { } ;
7
7
8
8
var Upload = React . createClass ( {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " rc-upload" ,
3
- "version" : " 1.0 .0" ,
3
+ "version" : " 1.1 .0" ,
4
4
"description" : " upload ui component for react" ,
5
5
"keywords" : [
6
6
" react" ,
40
40
"browser-test-cover" : " node --harmony node_modules/.bin/rc-tools run browser-test-cover"
41
41
},
42
42
"devDependencies" : {
43
+ "co-busboy" : " ^1.3.0" ,
43
44
"expect.js" : " 0.3.x" ,
45
+ "node-dev" : " 2.x" ,
44
46
"precommit-hook" : " 1.x" ,
45
47
"rc-server" : " 2.x" ,
46
48
"rc-tools" : " 2.x" ,
47
- "react" : " 0.13.x" ,
48
- "node-dev" : " 2.x"
49
+ "react" : " 0.13.x"
49
50
},
50
51
"precommit" : [
51
52
" lint" ,
Original file line number Diff line number Diff line change 1
1
var app = require ( 'rc-server' ) ( ) ;
2
+ var parse = require ( 'co-busboy' ) ;
3
+
2
4
app . use ( function * ( ) {
3
5
if ( this . url === '/upload.do' ) {
4
- this . set ( 'Content-Type' , 'text/html' ) ;
6
+ var parts = parse ( this , {
7
+ autoFields : true // saves the fields to parts.field(s)
8
+ } ) ;
9
+ var files = [ ] ;
10
+ var part = yield parts ;
11
+ files . push ( part . filename ) ;
5
12
this . status = 200 ;
6
- this . res . end ( '["hello"]' ) ;
13
+ this . set ( 'Content-Type' , 'text/html' ) ;
14
+ this . res . end ( JSON . stringify ( files ) ) ;
7
15
return ;
8
16
}
9
17
} ) ;
You can’t perform that action at this time.
0 commit comments