Vue:Error in render “TypeError Cannot read properties of undefined (reading ‘id‘)“

created at 05-29-2022 views: 4


Error in render “TypeError Cannot read properties of undefined (reading ‘id‘)“

In the process of my own development, I encountered this problem, and I reported an error when Vue wrote delete to delete axios.


 async deletePriceList(){
    // const {data: results} = await this.$'/section/abc',{params:{}}); 
    //This format is not very clear where there is a problem, but later changed to the following method to solve it, using the splicing method.
    const {data: results} = await this.$'/section/abc?id='
    if(results.status !== 200) return this.$message.error("failed to add")
        // reload data
        console.log("deleted successfully!")

After changing to this, the front end was solved, but it started to report 403 all the time. In general, it was a code problem that resulted in no access rights, so I modified the back-end code;

//deletemapping()// When using this annotation, it should be subject to some kind of permission, so if you encounter such a similar problem, you can try this method.

public SysResult deleteSection(Integer id){
    return SysResult.success();
created at:05-29-2022
edited at: 05-29-2022: