Skip to main content

常见问题

在 ios 12.0 版本中,Axios Post 请求数据,响应状态为 0,响应未定义

ios 12 跨域发送 post 请求, 如接口响应的跨域头: Access-Control-Allow-Headers:,ios12 会出现跨域问题,为了兼容性,建议用 'Content-Type': 'application/x-www-form-urlencoded'的方式发送 post 请求

axios.post( apiUrl, qs.stringify({name: 'testName', pass: 'testPass'}), {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(//***).catch(//***)

参考地址:

移动端

移动端关闭浏览器岁网页变色功能

解决方案:设置-关闭浏览器岁网页变色功能

监听屏幕锁定

javascript 无法监听锁屏事件(通过 BroadcastReceiver 广播是否可行需要测试)

参考