servletPath:/indexRestService/defaultOpen pathInfo:null
Posted 364.99°
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了servletPath:/indexRestService/defaultOpen pathInfo:null相关的知识,希望对你有一定的参考价值。
1.bug日志
已经开启后端项目,启动前端项目进行账户登录的时候,后台报错如下:
servletPath:/indexRestService/defaultOpen
pathInfo:null
headers:
x-forwarded-host: localhost:8080
x-forwarded-proto: http
x-forwarded-port: 8080
x-forwarded-for: 127.0.0.1
cookie: Webstorm-fc409ba6=1f59ddc6-924f-4af2-8693-eb95cf06799e; Idea-ea9890df=de87d0fc-840e-4678-b08b-36e83a7ef1af
accept-language: zh-CN,zh;q=0.9
accept-encoding: gzip, deflate, br
referer: http://localhost:8080/index.html
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
origin: http://localhost:8080
sec-ch-ua-platform: “Windows”
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
sec-ch-ua-mobile: ?0
content-type: application/x-www-form-urlencoded; charset=UTF-8
accept: application/json, text/plain, /
sec-ch-ua: “.Not/A)Brand”;v=“99”, “Google Chrome”;v=“103”, “Chromium”;v=“103”
content-length: 67
connection: close
host: 127.0.0.1:8081
2.解决方案
日志前两行已经给出了错误原因:
servletPath:/indexRestService/defaultOpen
路径信息:空
这是跨域问题:即 你前端配置后端是127.0.0.1,访问也要用127.0.0.1
以上是关于servletPath:/indexRestService/defaultOpen pathInfo:null的主要内容,如果未能解决你的问题,请参考以下文章