Egg still prompts csrf missing to ask configuration questions after setting up token

report an error

DELETE /customers/del/5] missing csrf token. See https://eggjs.org/zh-cn/core/security.html-sharpcsrf

config.js
    config.cors = {
        // {string|Function} origin: "*",
        allowMethods: "GET,HEAD,PUT,POST,DELETE,PATCH",
        credentials: true
      };
      xframe: {
          enable: false,
        },
        csrf: {
          headerName: "csrftoken",
          ignoreJSON: true, //  false true  content-type  `application/json` 
        },
        

whitelist is also set. The problem now is that all GET,PUT,POST can be passed, but DELETE cannot. The foreground request is axios.delete (ip +"/ customers/del/" + id)

.

I don"t understand! I hope the master will give me some advice!


check whether network doesn't have header with it


Why did I report 404 after setting it up like this?

Menu