日志
xhr.js?b50d:178 POST https://127.0.0.1:5000/login net::ERR_SSL_PROTOCOL_ERROR
dispatchXhrRequest @ xhr.js?b50d:178
xhrAdapter @ xhr.js?b50d:12
dispatchRequest @ dispatchRequest.js?5270:52
Promise.then (async)
request @ Axios.js?0a06:61
Axios.<computed> @ Axios.js?0a06:86
wrap @ bind.js?1d2b:9
login @ Login.vue?7463:85
invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1854
invoker @ vue.runtime.esm.js?2b0e:2179
invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1854
Vue.$emit @ vue.runtime.esm.js?2b0e:3888
click @ VBtn.ts?0eff:158
invokeWithErrorHandling @ vue.runtime.esm.js?2b0e:1854
invoker @ vue.runtime.esm.js?2b0e:2179
original._wrapper @ vue.runtime.esm.js?2b0e:6917
createError.js?2d83:16 Uncaught (in promise) Error: Network Error
at createError (createError.js?2d83:16)
at XMLHttpRequest.handleError (xhr.js?b50d:83)
解决方案:把https 修改为http
import axios from 'axios'
const instance = axios.create({
修改后代码:baseURL: 'http://127.0.0.1:5000/',
修改前代码:baseURL: 'https://127.0.0.1:5000/',
timeout: 10000,
headers: {'X-Custom-Header': 'foobar'}
});
export default instance
博客内容介绍了在遇到接口请求时出现的net::ERR_SSL_PROTOCOL_ERROR错误,提供了一个简单的解决方案,即把HTTPS协议改为HTTP协议。
1万+

被折叠的 条评论
为什么被折叠?



