Typescript axios post passes the array to the background to report an error, solve it! Thank you!

async saveMenu(data: Model[]) {

    let reqConfig: AxiosRequestConfig = {
        method: "post",
        url: globalConfig.prefixPath + "/webapp/api/menu/save",
        data: { data: data},
        headers: {
            "Content-Type": "application/json"
        }
    };
    let dr = await Axios.request(reqConfig);
  
    return dr
}

clipboard.png

Apr.02,2022

is caused by circular references again. Use the following code to solve
let cache: any = []

    let str = JSON.stringify(pd, function (key, value) {
        if (typeof value === 'object' && value !== null) {
            if (cache.indexOf(value) !== -1) {
                // Circular reference found, discard key
                return;
            }
            // Store value in our collection
            cache.push(value);
        }
        return value;
    });
Menu