1***@qq.com
1***@qq.com
  • 发布:2020-11-05 10:11
  • 更新:2020-11-05 11:09
  • 阅读:1102

HBuilderX真机调试,访问https接口一直返回abort

分类:MUI

HBuilderX真机调试,访问https接口一直返回abort

2020-11-05 10:11 负责人:无 分享
已邀请:
全栈工程师

全栈工程师 - 精通mui、uniapp,承接相关项目外包,解决各种疑难问题。有任何问题可以随时联系,QQ:419761282

检查url是否能正常请求,是否存在跨域 是不是正常使用的ajax? 问题可以描述清楚点,可以联系我解决

  • 1***@qq.com (作者)

    mui.ajax(ApiUrl + "/home",{

    type:"post",

    data:{},

    dataType:'json',//服务器返回json格式数据

    crossDomain:true,

    success: function(result) {


                        G("navTitle").innerText = result.datas.sitename;  

    if(result.datas.banner.length > 0){

    var html = '';

    mui.each(result.datas.banner, function(index, item){

    html += '<li><a id="'+item.id+'"><img _src="'+item.pic+'" src="../images/blank.png" /></a></li>';

    });

    G("banner").innerHTML = html;

    TouchSlide({
    slideCell: "#focus",
    titCell: ".hd ul", //开启自动分页 autoPage:true ,此时设置 titCell 为导航元素包裹层
    mainCell: ".bd ul",
    effect: "left",
    autoPlay: true, //自动播放
    autoPage: true, //自动分页
    delayTime: 1000,
    interTime: 5000,
    switchLoad: "_src" //切换加载,真实图片路径为"_src"
    });

    mui("#banner").on('tap', 'a', function() {
    var id = this.id;

    mui.openWindow({
    url: 'pages/article.html',
    id: 'article',
    preload: true,
    show: {
    aniShow: 'pop-in'
    },
    styles: {
    popGesture: 'hide'
    },
    waiting: {
    autoShow: false
    }
    });

    var muiPage = plus.webview.getWebviewById('article');
    //触发详情页面的newsId事件
    mui.fire(muiPage, 'article', {'id': id});

    });

    }

    },
    error: function(xhr,type,error) {
    console.log(type);
    mui.alert("网络异常");
    return;
    }
    });

    }

    在浏览器可以正常访问,跨域我设置了,其他都可以请求,就这一个接口怎么都不行

    2020-11-05 11:25

该问题目前已经被锁定, 无法添加新回复