Iview upload component

in template

 
<div> 
   <Upload
    action="http://192.168.5.4:9090/upload/image"
    :data="datas"
    :with-credentials="true"
    :before-upload="beforeUpload"
    >
    <div style="padding: 20px 100px">
        <Icon type="ios-cloud-upload" size="52" style="color: -sharp3399ff"></Icon>
        

</div> </Upload>

bind data

      
        datas:{
                type: 4,
                image: null
            },

in methods

beforeUpload(file) {
    this.datas.image = file
    console.log(this.datas)
}

clipboard.png

I don"t know why 403

can be passed on postman

Sep.26,2021

the address of http://192.168.5.4:9090/upload/image is cross-domain, ha. You need to configure a proxy in proxyTable. Postman is not a web page, so there is no cross-domain problem.

Menu