为了账号安全,请及时绑定邮箱和手机立即绑定

运行文件时出现GET http://localhost:8080/api 404 (Not Found)。

运行文件时出现GET http://localhost:8080/api 404 (Not Found)。

慕田峪2258837 2019-05-23 06:59:43
用VUE仿链家网的时候,运行文件时出现GET http://localhost:8080/api 404 (Not Found)。dev: {   // Paths   assetsSubDirectory: 'static',   assetsPublicPath: '/',   proxyTable: {     '/api': {       target: 'http://47.110.132.127:6789/city/get/data',       changeOrigin: true,       pathRewrite: {         '^/api': '/data'       }     }   },      getPageInfo () {   /// 地址为后台数据地址为后台数据地址为后台数据地址为后台数据地址为后台数据   axios.get('/api', {     headers: {       'Content-Type': 'application/x-www-form-urlencoded'     }   })     .then(function (res) {       res = res.data       if (res.ret && res.data) {         const data = res.data         this.total = data.total         this.pagingVolume = data.pagingVolume         this.current = data.current         this.contentList = data.contentList /// 前后名字一样       }     }) /// 先接受json文件,然后返回函数     .catch(function (error) {       console.log(error)     }) }
查看完整描述

1 回答

?
pardon110

TA贡献1038条经验 获得超227个赞

访问本地接口看看不就知道了

查看完整回答
反对 回复 2019-05-25
  • 1 回答
  • 0 关注
  • 17445 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信