发起post请求时需要手动设置headers的contentType为表单类型
ajax.post(AccountApis.loginUrl, {
username: 'xxxx',
password: 'xxxx'
}, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded' // 设置请求头为表单编码
}
})
.then((res) => {
xxxxxx
})
发起post请求时需要手动设置headers的contentType为表单类型
ajax.post(AccountApis.loginUrl, {
username: 'xxxx',
password: 'xxxx'
}, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded' // 设置请求头为表单编码
}
})
.then((res) => {
xxxxxx
})