【vue】Uncaught (in promise) Error: Request failed with status code 404
错误原因:跨域访问是路径出错,多了“”
·
报错:Uncaught (in promise) Error: Request failed with status code 404
错误:
错误原因:写axios工具类的代理路径出错,多了“”
// 创建axios实例
const service = axios.create({
baseURL: '"http://localhost:9001"', // api 的 base_url
timeout: 20000 // 请求超时时间
})
删除双引号即可
造成这个错误的原因不是前端路径错了,就是后端写@RestMapping(“b/a”)里面少了/,改为@RestMapping(“/b/a”)即可,这个@RestMapping是类上的。
更多推荐
已为社区贡献1条内容
所有评论(0)