发布网友 发布时间:2022-06-27 16:48
共1个回答
热心网友 时间:2024-12-04 06:27
摘要解决方法:输入代码:在webpack。dev。conf。js里//需安装express和axios才能引用constaxios=require('axios')constexpress=require('express')constapp=express()constapiRoutes=express.Router()app.use('/api',apiRoutes)在本文件的devServer对象里写入这句就行了before(app){app.get('/getDiscList',function(req,res){varurl='https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg'},params:req.query}).then((response)=>{res.json(response.data)}).catch((e)=>{console.log(e.response)咨询记录 · 回答于2021-12-11request failed with status code 504怎么解决 解决方法:输入代码:在webpack。dev。conf。js里//需安装express和axios才能引用constaxios=require('axios')constexpress=require('express')constapp=express()constapiRoutes=express.Router()app.use('/api',apiRoutes)在本文件的devServer对象里写入这句就行了before(app){app.get('/getDiscList',function(req,res){varurl='https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg'},params:req.query}).then((response)=>{res.json(response.data)}).catch((e)=>{console.log(e.response)希望我的回答可以帮助到您