The ajax post request submission parameter returned status=200, but the code=0 display operation failed.

there is an add function, ajax post request submission parameter returned status=200, but the code=0 display operation failed, and then the data is not in data, but in config.data

    add(){
        let data = {
          systemDeptName: "test",
          systemDeptParentId: 546515268,
          systemDeptSort: 1,
          systemDeptRemark: ""
        }
        this.$http.post("/api/admin/safe/dept/add",data).then((res)=>{
            console.log(res)
        })
    },  
    

clipboard.png

ask for advice

Oct.20,2021

this problem should be handled by the server. There is no problem with the handling of ajax. For specific reasons, you should consult the students who provide the interface on your server. If the server is written by node itself, the processing logic of the server should also be posted.


response 200 simply means that the server has responded to the request normally, and exactly why the operation failed should depend on the back-end logic.

Menu