GithubHelp home page GithubHelp logo

Comments (9)

xyxiao001 avatar xyxiao001 commented on May 12, 2024

这样传过去就是base64的值

from vue-cropper.

zhangwei900808 avatar zhangwei900808 commented on May 12, 2024

大神可知道如何获取,java后台

from vue-cropper.

xyxiao001 avatar xyxiao001 commented on May 12, 2024

http://blog.csdn.net/hopperpanda/article/details/52813496

from vue-cropper.

zhangwei900808 avatar zhangwei900808 commented on May 12, 2024

有没有其它的方式获取这个图片啊

from vue-cropper.

xyxiao001 avatar xyxiao001 commented on May 12, 2024

blob 表单提交也可以

from vue-cropper.

zhangwei900808 avatar zhangwei900808 commented on May 12, 2024

获取截图的blob数据
this.$refs.cropper.getCropBlob((data) => {
// do something
console.log(data)
})

看到了:)

from vue-cropper.

zhangwei900808 avatar zhangwei900808 commented on May 12, 2024

现在不知道后台如何获取了

from vue-cropper.

xyxiao001 avatar xyxiao001 commented on May 12, 2024

可以塞到formdata 里面用表单提交过去

from vue-cropper.

zhangwei900808 avatar zhangwei900808 commented on May 12, 2024

对的,已经成功了,谢谢了:)

this.$refs.cropper.getCropBlob((data) => {
                this.$refs.avatarForm.reset();

                let formdata = new FormData();
  	            formdata.append('imgStream',data);
                
                let config = {
                        headers:{'Content-Type': 'multipart/form-data'  //之前说的以表单传数据的格式来传递fromdata
                    }
                };

                this.$post(`${this.$url}/teacher/uploadFileToQiniu`,formdata,config)
                .then(res=>{

                })
                .catch(err=>{

                })
            })
@PostMapping("/uploadFileToQiniu")
    public String uploadFileToQiniu(@RequestParam("imgStream") MultipartFile imgStream) throws IOException {
        AjaxResult result = new AjaxResult();

        InputStream content = imgStream.getInputStream();

        qiniuService.uploadFile(content);
        result.setMsg("上传成功");
        result.setSuccess(true);
        return JSON.toJSONString(result);
    }

from vue-cropper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.