【ruoyi-cloud】解决若依前端项目部署后无法访问到后端接口
·
问题描述

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';
}
更多推荐



所有评论(0)