如何通过android应用(使用phonegap / cordova创建)对服务器进行剩余调用时如何删除源:file://?

问题描述 投票:0回答:1

我正在像下面这样对服务器进行ajax调用:

$.ajax({
          type : "POST",
          dataType : "json",
          url : url+ "/oms/rest/XYZ/anon/uvw/grantAbc",
          data : {
            "username" : username,
            "password" : password
          },

但是在服务器端却失败了,因为origin:file://正在通过rest调用发送。requesr header

android cordova cordova-plugins phonegap-plugins phonegap
1个回答
0
投票

您不能从file://更改原点,因为您实际上没有原点。问题是您的REST后端不允许file://作为源。您需要在后端进行更改。

© www.soinside.com 2019 - 2024. All rights reserved.