鍍金池/ 問(wèn)答/網(wǎng)絡(luò)安全  HTML/ vue axios post數(shù)據(jù)報(bào)錯(cuò)504

vue axios post數(shù)據(jù)報(bào)錯(cuò)504

vue文件:

axios.post('/api/nameCheck', {
                name: this.ruleForm2.name
              })
              .then(function (response) {

config/index.js:(target改過(guò)本機(jī)ip:3000和127.0.0.1:3000均失?。?/p>

proxyTable: {
         '/api': {
            target: 'http://localhost:3000/',
            changeOrigin: true,
            // pathRewrite: {
            //   '^/api': ''
            // }
        }
    },

server/app.js:

var users = require('./routes/users');
app.use('/api', users);

routes/users:

router.post('/nameCheck', function(req, res, next) {
    
    return res.send('totally');
});

報(bào)錯(cuò):POST http://localhost:8089/api/nameCheck 504 (Gateway Timeout)
(node后端已打開(kāi),用localhost:3000可以正常訪問(wèn))
[HPM] Error occurred while trying to proxy request /api/nameCheck from localhost:8089 to http://175.8.15x.xx:3000/ (ECONNREFUSED) (https://nodejs.org/api/errors...
(ECONNREFUSED)

(其實(shí)昨天還能連接上的,不知道為什么今天就連不上了。。)
請(qǐng)問(wèn)有具體的解決辦法嗎?

回答
編輯回答
有點(diǎn)壞

504 是網(wǎng)關(guān)問(wèn)題 你前端hold不住的 去你的后臺(tái)

2018年4月24日 19:19
編輯回答
忠妾

昨天能連上,那么可以從你今天改動(dòng)的代碼去排查

2017年11月6日 20:31