Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
234 views
in Technique[技术] by (71.8m points)

jqeury的ajax方法在https报错

同样的thinkphp5.1后端调用接口方法,用http的ajax访问正常输出返回值,但是切换到https就报错,前端调试控制台错误提示:net::ERR_CONNECTION_RESET,以https直接访问此后端url也能正常输出返回值,请问这是什么原因?
360截图17860605110132147.jpg
360截图17040511115132125.jpg### 问题描述

问题出现的环境背景及自己尝试过哪些方法

把async设置成true和false都试过,没有用

相关代码

function send_email_code() {

$.ajax({
    data: {
        'email': $("#security_email").val()
    },
    type: 'POST'
    ,
    url: "sendEmailCode",
    success: function (data, status) {
        $("#email_hint").html(data);

    },
    complete:function(XHR, TS){
        console.log('xhr:'+XHR+','+'TS:'+TS);    
    },
    error: function (jqXHR, textStatus, errorThrown) {
        // alert(object+'|'+error+'|'+exception_ex);
        console.log('jqXHR.responseText --> ',jqXHR.responseText);
        console.log('jqXHR.status --> ',jqXHR.status);
        console.log('jqXHR.readyState --> ',jqXHR.readyState);
        console.log('jqXHR.statusText --> ',jqXHR.statusText);
        /*其他两个参数的信息*/
        console.log('textStatus --> ',textStatus);
        console.log('errorThrown --> ',errorThrown);
    },
    async:true
})

}

你期待的结果是什么?实际看到的错误信息又是什么?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

可以检查一下,看看是不是后台配置某种配置的原因...csdn


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...