他的回复:
前端代码: getSession() { var axios = require('axios'); var data = JSON.stringify(null); var config = { method: 'post', url: '/action.cgi/?ActionID=WEB_RequestSessionIDAPI', headers: { }, data: data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); }); var config = { method: 'post', url: '/action.cgi?ActionID=Web_RequestSessionID?rmd=0.06144435046740693', headers: { 'ClientType': 'browser', 'X-Requested-With': 'XMLHttpRequest', 'userType': 'web', 'Content-Type': 'application/json' }, data: data }; axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); }); } 代理配置: proxyTable: { '/action.cgi': { // 大屏的IP: 192.168.6.173 target: "https://192.168.6.173:443", changeOrigin: true, secure: false } },