登录功能路由:
router.post('/login', (req, res) => {
let {
workId, password } = req.body
var config = {
method: 'post',
baseURL: 'http://******',
url: '/login',
params: {
workId,
password,
},
headers: {
//指定响应头
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
// "Accept": "application/json"
}
}
axios(config)