wendux / DSBridge-IOS

:earth_asia: A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DSBridge-IOS +ajax+https无法成功请求

zhoushangzhi opened this issue · comments

感谢作者的奉献。我们在用DSBridge-IOS时,采用VUE+DWKWebView。在VUE中使用axios发起ajax的https的get请求,去请求一个api,无法得到返回值,用vconsole查看请求的status 为0. 此问题在android、pc上不存在,一切正常。

import axios from 'axios'
let Url="https://www.baidu.com";
axios.get(Url).then((data)=>{
console.log(data);
})

后经测试在纯 wkwebview下也无法正常通过ajax发起https请求。是否能帮忙看一下要如何处理,或是否DSBridge可以集成支持https相关访问。此问题已经困扰很久。

参照CORS,设置Access-Control-Allow-Origin: *即可

commented

此为h5代码问题,和本项目无关,在这讨论不合适,关闭了。

:octocat: From gitme Android