Flask api 从本机端调用获取请求,但拒绝访问

问题描述

我正在尝试使用 fetch 从反应本机端调用flask api,它在android中正常工作,但在从ios调用时总是拒绝访问。 这是从 react native 调用的 api:

BackgroundTimer.runBackgroundTimer(() => {

fetch('http://192.168.1.9:8088/notification_view/api/read',{ 方法:'GET',

      // body: data,})
     .then(response => response.json())
     .then((res) => {
      console.log('response',res); 
      }).catch((e)=>{
      console.log(e)
       })
  },30000);

这个 api 每 30 秒在后台调用一次。 api 响应: {"message": "Access is Denied","severity": "danger"}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)