运行源代码报错

来源:2-1 nodejs和npm的安装和环境搭建

Syntax_Error

2019-05-06

xhr.js?14ed:178 GET http://localhost:8080/users/checkLogin 504 (Gateway Timeout)
dispatchXhrRequest @ xhr.js?14ed:178
xhrAdapter @ xhr.js?14ed:12
dispatchRequest @ dispatchRequest.js?91bc:52
Promise.then (async)
request @ Axios.js?483c:58
Axios.(anonymous function) @ Axios.js?483c:68
wrap @ bind.js?5cdd:9
checkLogin @ NavHeader.vue?9e3e:174
mounted @ NavHeader.vue?9e3e:170
invokeWithErrorHandling @ vue.esm.js?65d7:1863
callHook @ vue.esm.js?65d7:4222
insert @ vue.esm.js?65d7:3148
invokeInsertHook @ vue.esm.js?65d7:6351
patch @ vue.esm.js?65d7:6570
Vue._update @ vue.esm.js?65d7:3948
updateComponent @ vue.esm.js?65d7:4069
get @ vue.esm.js?65d7:4482
Watcher @ vue.esm.js?65d7:4471
mountComponent @ vue.esm.js?65d7:4076
Vue.mount@vue.esm.js?65d7:9057Vue.mount @ vue.esm.js?65d7:9057 Vue.mount@vue.esm.js?65d7:9057Vue.mount @ vue.esm.js?65d7:11953
Vue._init @ vue.esm.js?65d7:5021
Vue @ vue.esm.js?65d7:5088
(anonymous) @ main.js?1c90:46
(anonymous) @ app.js:925
webpack_require @ app.js:660
fn @ app.js:86
(anonymous) @ app.js:1422
webpack_require @ app.js:660
(anonymous) @ app.js:709
(anonymous) @ app.js:712
xhr.js?14ed:178 GET http://localhost:8080/goods/list?page=1&pageSize=8&sort=1&priceLevel=all 504 (Gateway Timeout)
dispatchXhrRequest @ xhr.js?14ed:178
xhrAdapter @ xhr.js?14ed:12
dispatchRequest @ dispatchRequest.js?91bc:52
Promise.then (async)
request @ Axios.js?483c:58
Axios.(anonymous function) @ Axios.js?483c:68
wrap @ bind.js?5cdd:9
getGoodsList @ GoodsList.vue?c017:137
mounted @ GoodsList.vue?c017:120
invokeWithErrorHandling @ vue.esm.js?65d7:1863
callHook @ vue.esm.js?65d7:4222
insert @ vue.esm.js?65d7:3148
invokeInsertHook @ vue.esm.js?65d7:6351
patch @ vue.esm.js?65d7:6570
Vue._update @ vue.esm.js?65d7:3948
updateComponent @ vue.esm.js?65d7:4069
get @ vue.esm.js?65d7:4482
Watcher @ vue.esm.js?65d7:4471
mountComponent @ vue.esm.js?65d7:4076
Vue.mount@vue.esm.js?65d7:9057Vue.mount @ vue.esm.js?65d7:9057 Vue.mount@vue.esm.js?65d7:9057Vue.mount @ vue.esm.js?65d7:11953
Vue._init @ vue.esm.js?65d7:5021
Vue @ vue.esm.js?65d7:5088
(anonymous) @ main.js?1c90:46
(anonymous) @ app.js:925
webpack_require @ app.js:660
fn @ app.js:86
(anonymous) @ app.js:1422
webpack_require @ app.js:660
(anonymous) @ app.js:709
(anonymous) @ app.js:712
createError.js?f777:16 Uncaught (in promise) Error: Request failed with status code 504
at createError (createError.js?f777:16)
at settle (settle.js?199f:18)
at XMLHttpRequest.handleLoad (xhr.js?14ed:77)
createError @ createError.js?f777:16
settle @ settle.js?199f:18
handleLoad @ xhr.js?14ed:77
Promise.then (async)
checkLogin @ NavHeader.vue?9e3e:174
mounted @ NavHeader.vue?9e3e:170
invokeWithErrorHandling @ vue.esm.js?65d7:1863
callHook @ vue.esm.js?65d7:4222
insert @ vue.esm.js?65d7:3148
invokeInsertHook @ vue.esm.js?65d7:6351
patch @ vue.esm.js?65d7:6570
Vue._update @ vue.esm.js?65d7:3948
updateComponent @ vue.esm.js?65d7:4069
get @ vue.esm.js?65d7:4482
Watcher @ vue.esm.js?65d7:4471
mountComponent @ vue.esm.js?65d7:4076
Vue.mount@vue.esm.js?65d7:9057Vue.mount @ vue.esm.js?65d7:9057 Vue.mount@vue.esm.js?65d7:9057Vue.mount @ vue.esm.js?65d7:11953
Vue._init @ vue.esm.js?65d7:5021
Vue @ vue.esm.js?65d7:5088
(anonymous) @ main.js?1c90:46
(anonymous) @ app.js:925
webpack_require @ app.js:660
fn @ app.js:86
(anonymous) @ app.js:1422
webpack_require @ app.js:660
(anonymous) @ app.js:709
(anonymous) @ app.js:712
createError.js?f777:16 Uncaught (in promise) Error: Request failed with status code 504
at createError (createError.js?f777:16)
at settle (settle.js?199f:18)
at XMLHttpRequest.handleLoad (xhr.js?14ed:77)

写回答

1回答

河畔一角

2019-05-08

你好,根据你的错误来看,后台接口不通,需要把后台启动起来,通过pm2插件或者node来启动,如果依然无法解决,加我534877846

0
0

Vue2.6+Node.js+MongoDB 全栈打造商城系统

课程全面升级,Vue2.6+Koa2,从前端入门全栈,让你的未来更宽广

2634 学习 · 924 问题

查看课程