【SpringMVC】ajax请求成功一次后一直失败,解决办法

加上

cache: false

就解决了。

function upload() {
    
    
        let data=new FormData(document.getElementById("up_form"));
        $.ajax({
    
    
            url: "/upload",
            type: "post",
            data: data,
            cache: false,
            contentType: false,
            processData : false, // 使数据不做处理
            success: (data)=>{
    
    
                alert(data)
            }
        })
    }

猜你喜欢

转载自blog.csdn.net/qq_42158942/article/details/103896464