原生如何远程加载 json配置文件?

已尝试方法:

    let xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function () {
        cc.log(JSON.stringify(xhr))
        if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
            let response = xhr.responseText;
            let obj = JSON.parse(response)
            console.log("远程config加载完成")
        }else{
            console.log("远程config加载失败")
        }
    };
    xhr.open("GET", "https://enjoygaga.com/config/test.json", true);
    xhr.send();

无法加载。。。。。。

已解决

怎么解决的