{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/1876","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/1876/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/1876/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/1876/events","html_url":"https://github.com/ant-design/ant-design/issues/1876","id":157139278,"number":1876,"title":"上传图片后点击移除后利用onRemove回调可以把远端服务器的图片删除但本地预览的图片依然存在,要怎么同时去除本地预览图呢?","user":{"login":"laolu87","id":17420214,"avatar_url":"https://avatars.githubusercontent.com/u/17420214?v=3","gravatar_id":"","url":"https://api.github.com/users/laolu87","html_url":"https://github.com/laolu87","followers_url":"https://api.github.com/users/laolu87/followers","following_url":"https://api.github.com/users/laolu87/following{/other_user}","gists_url":"https://api.github.com/users/laolu87/gists{/gist_id}","starred_url":"https://api.github.com/users/laolu87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laolu87/subscriptions","organizations_url":"https://api.github.com/users/laolu87/orgs","repos_url":"https://api.github.com/users/laolu87/repos","events_url":"https://api.github.com/users/laolu87/events{/privacy}","received_events_url":"https://api.github.com/users/laolu87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-27T06:32:33Z","updated_at":"2016-05-27T06:34:10Z","closed_at":null,"body":"图片样式定义:        \r\n   <FormItem  key = '5'\r\n              label=\"图片：\"\r\n              labelCol={{ span: 4 }}\r\n              wrapperCol={{ span: 17 }}\r\n              help=\"请上传图片\"\r\n              required>\r\n              <div className=\"clearfix\">\r\n               <Upload name=\"File\" action={`${SERVER_HOST}/uploads?token=${token}`} listType=\"picture-card\" name='uploadFile'\r\n               onRemove={this.onRemove}\r\n                {...getFieldProps('pics', {\r\n                  valuePropName: 'fileList',\r\n                  normalize: this.normFile,\r\n                })}>\r\n                 <Icon type=\"plus\" />\r\n                 <div className=\"ant-upload-text\">上传图片</div>\r\n               </Upload>\r\n               <Modal visible={this.state.priviewVisible} footer={null} onCancel={this.handleCancel}>\r\n                 <img alt=\"example\" src={this.state.priviewImage} />\r\n               </Modal>\r\n              </div>\r\n            </FormItem>\r\n\r\n\r\n onRemove回调函数:\r\n  onRemove(file){\r\n    const uid = file.uid\r\n    const token = localStorage.getItem('token')\r\n    superagent\r\n    .delete(`${SERVER_HOST}/uploads/${file.response.id}?token=${token}`)\r\n    .end((err, res)=>{\r\n      const text = JSON.parse(res.text)\r\n      // console.log(text)\r\n      if(!err && !text.message){\r\n        message.success('删除成功')\r\n      }else{message.error('删除失败')}\r\n    })\r\n  },\r\n\r\n麻烦大家帮我看看需要怎么改写,谢谢了!"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/222071017","html_url":"https://github.com/ant-design/ant-design/issues/1876#issuecomment-222071017","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/1876","id":222071017,"user":{"login":"laolu87","id":17420214,"avatar_url":"https://avatars.githubusercontent.com/u/17420214?v=3","gravatar_id":"","url":"https://api.github.com/users/laolu87","html_url":"https://github.com/laolu87","followers_url":"https://api.github.com/users/laolu87/followers","following_url":"https://api.github.com/users/laolu87/following{/other_user}","gists_url":"https://api.github.com/users/laolu87/gists{/gist_id}","starred_url":"https://api.github.com/users/laolu87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laolu87/subscriptions","organizations_url":"https://api.github.com/users/laolu87/orgs","repos_url":"https://api.github.com/users/laolu87/repos","events_url":"https://api.github.com/users/laolu87/events{/privacy}","received_events_url":"https://api.github.com/users/laolu87/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T06:34:10Z","updated_at":"2016-05-27T06:34:10Z","body":"            <FormItem  key = '5'\r\n              label=\"图片：\"\r\n              labelCol={{ span: 4 }}\r\n              wrapperCol={{ span: 17 }}\r\n              help=\"请上传图片\"\r\n              required>\r\n              <div className=\"clearfix\">\r\n               <Upload name=\"File\" action={`${SERVER_HOST}/uploads?token=${token}`} listType=\"picture-card\" name='uploadFile'\r\n               onRemove={this.onRemove}\r\n                {...getFieldProps('pics', {\r\n                  valuePropName: 'fileList',\r\n                  normalize: this.normFile,\r\n                })}>\r\n                 <Icon type=\"plus\" />\r\n                 <div className=\"ant-upload-text\">上传图片</div>\r\n               </Upload>\r\n               <Modal visible={this.state.priviewVisible} footer={null} onCancel={this.handleCancel}>\r\n                 <img alt=\"example\" src={this.state.priviewImage} />\r\n               </Modal>\r\n              </div>\r\n            </FormItem>"}}
{"actor":{"display_login":"laolu87"}}