我有一个发行令牌的文件,如下所示:
<?
header('Access-Control-Allow-Origin: *');
include "lib/autoload.php";
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('g4kg867qf29jn4tr');
Braintree_Configuration::publicKey('wtqnf5txh7372nqm');
Braintree_Configuration::privateKey('67ad648bba28812356a0d9528d0aa38c');
echo($clientToken = Braintree_ClientToken::generate());
?>
我有一些angular / ionic / typescript会向上面的文件发送一个get请求:
this.http.request('http://192.168.1.131:8888/generatetoken.php')
.subscribe(res => {
resolve(res.text());
}, err => console.log(err))
错误是:
Response with status: 0 for URL
我之前发生了这种情况并添加header('Access ...
修复了它,现在它似乎正在发生,因为它。我需要改变什么?