Cordova CORS SMP 자원 요청 실패

6710 단어 SAP-UI5SAPUI5
코드:
    test1: function() {
        $.ajax({
            type : "GET",
            cache : false,
            url: "http://smp.springworks.info:8081/app1/test/index2.jsp",
            beforeSend : function(request) {

            },

            success : function(data, ajaxOptions, xhr) {
                mymodules.Module1.debug("READ SUCCESS");
                alert(data);
            },
            error : function(xhr, ajaxOptions, thrownError) {
                mymodules.Module1.debug("READ FAILED");
                alert(JSON.stringify(xhr));
                alert(JSON.stringify(ajaxOptions));
                alert(JSON.stringify(thrownError));
            }
        });

    },

wireshark 모니터링 로그:
IGET /app1/test/index2.jsp?_=1476917522183 HTTP/1.1
Host: www.mdm.springworks.info:8081
Connection: keep-alive
Accept: */*
Origin: file://
User-Agent: Mozilla/5.0 (Linux; Android 5.0.2; Redmi Note 3 Build/LRX22G; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/45.0.2454.95 Mobile Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,en-US;q=0.8
X-Requested-With: com.mycompany.logon

HTTP/1.1 403 Forbidden
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1009
Date: Wed, 19 Oct 2016 22:52:01 GMT
Server: SAP

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 코드:
    test1: function() {
        $.ajax({
            headers: {
                'X-SMP-APPCID': "c940cb2f-fef4-49d3-81e6-736273019fb4"
            },

            type : "GET",
            cache : false,
            url: "http://smp.springworks.info:8081/app1/test/index2.jsp",
            beforeSend : function(request) {

            },

            success : function(data, ajaxOptions, xhr) {
                mymodules.Module1.debug("READ SUCCESS");
                alert(data);
            },
            error : function(xhr, ajaxOptions, thrownError) {
                mymodules.Module1.debug("READ FAILED");
                alert(JSON.stringify(xhr));
                alert(JSON.stringify(ajaxOptions));
                alert(JSON.stringify(thrownError));
            }
        });

    },

SMP wireshak 모니터링 로그:


OPTIONS /app1/test/index2.jsp?_=1476917672878 HTTP/1.1
Host: smp.springworks.info:8081
Connection: keep-alive
Access-Control-Request-Method: GET
Origin: file://
User-Agent: Mozilla/5.0 (Linux; Android 5.0.2; Redmi Note 3 Build/LRX22G; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/45.0.2454.95 Mobile Safari/537.36
Access-Control-Request-Headers: accept, x-smp-appcid
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,en-US;q=0.8
X-Requested-With: com.mycompany.logon

HTTP/1.1 403 Forbidden
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1009
Date: Wed, 19 Oct 2016 22:54:32 GMT
Server: SAP

좋은 웹페이지 즐겨찾기