问题描述

在这里插入图片描述
getInfo 方法状态304有响应,
logout 方法状态405 DELETE方法被阻止了

解决方案:

修改nginx配置文件支持RESTful风格请求

location / { 
    try_files $uri $uri/ /index.html;
    index  index.html index.htm;
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
    add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐