Warning: Undefined array key "HTTPS" in include() (line 29 of /opt/www/fdv2/drupal.stage/web/sites/default/settings.local.php).
include('/opt/www/fdv2/drupal.stage/web/sites/default/settings.local.php') (Line: 4)
require('/opt/www/fdv2/drupal.stage/web/sites/drupal001.net/settings.php') (Line: 145)
Drupal\Core\Site\Settings::initialize('/opt/www/fdv2/drupal.stage/web', 'sites/drupal001.net', Object) (Line: 1099)
Drupal\Core\DrupalKernel->initializeSettings(Object) (Line: 701)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
使用ajax出现跨域302问题,如何解决,drupal我也加标题了,但不知道哪里出错? - Drupal大学 - Drupal问答论坛
首页 / 帖子
使用ajax出现跨域302问题,如何解决,drupal我也加标题了,但不知道哪里出错?

drupal_add_http_header('Content-Type', 'application/json;charset=utf8');
drupal_add_http_header('Content-Type', 'text/html; charset=UTF-8');
drupal_add_http_header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
drupal_add_http_header('Access-Control-Allow-Origin', '*');
加了这个好像没啥效果,是不是apache得设置东西,服务器端才能生效

1个答案
赵高欣
发布于:2016-11-11 15:38
header('Access-Control-Allow-Origin: http://m.xx.cn');
header('Access-Control-Allow-Credentials: true');

检查一下 http 头是否有问题,不行的话直接用 php 函数,写到 settings
.php 里面。