在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML5/ vue-cli 解決跨域 proxyTable設(shè)置無(wú)效 報(bào)錯(cuò)504 node報(bào)錯(cuò)

vue-cli 解決跨域 proxyTable設(shè)置無(wú)效 報(bào)錯(cuò)504 node報(bào)錯(cuò) 代理錯(cuò)誤

后臺(tái)服務(wù)器名 http://47.92.100.92:9002,配置 proxyTable:

    proxyTable: {
        '/api':{
            target: 'http://47.92.100.92:9002/',
            changeOrigin: true,
             pathRewrite: {
              '^api': '/api'
            }
        }
    },

在組件login中拿數(shù)據(jù)的時(shí)候

    methods: {
        Sign() {
            axios.post("/api/login", qs.stringify({
                username: that.loginInfo.username,
                password: that.loginInfo.userpass
            }),{
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded",
                    "Accept":"application/json"
                }
            }).then((response) => {
                //數(shù)據(jù)    success
                //                this.myData = res.data.info
                Indicator.close();
                console.log(response)
            }, (error) => {
                // error
                Indicator.close();
                console.log(error)
            });
        }
    }

            

當(dāng)點(diǎn)擊Sign的時(shí)候?yàn)g覽器報(bào)錯(cuò)

clipboard.png

node報(bào)錯(cuò)

Your application is running here: http://localhost:8080 [HPM] Error occurred while trying to proxy request /api/login from localhost:8080 to http://47.92.100.92:9002/ (ECONNREFUSED) (https://nodejs.org/api/errors...

clipboard.png

回答
編輯回答
鹿惑

不知道你是一直不能用,還是偶爾這樣,如果網(wǎng)絡(luò)不好,確實(shí)會(huì)出現(xiàn)這種情況,一般請(qǐng)求20s,還是請(qǐng)求不到數(shù)據(jù),就會(huì)返回504,網(wǎng)關(guān)請(qǐng)求超時(shí)。

2017年8月22日 08:51
編輯回答
下墜

哥們解決了嗎,我和你一樣的問(wèn)題?如果解決了能否告知?

2018年5月26日 17:07
編輯回答
大濕胸

樓主解決了?目前遇到一樣的問(wèn)題

2017年10月22日 17:57