4

我在 Django 应用程序之上有一个 ExtJS 应用程序,我需要发布到/accounts/logout/以使会话无效,然后重定向到/.

下面的代码在本地运行,但在具有 SSL 的实时站点上失败。我在通过 ExtJS 执行 Ajax POST 时遇到问题。代码如下:

Ext.Ajax.request({
    url: '/accounts/logout/',
    withCredentials: true,
    method: 'POST',
    success: function() {
        console.log('successfully logged out');
        window.location.href='/'
    }
});

Chrome 中的响应状态(cancelled)如下图所示: 在此处输入图像描述

此外,我在控制台级别收到此警告:

https://domain.example.com/显示来自 的不安全内容的页面http://console.pharmacy.com.mt/

我是否缺少上述Ext.Ajax请求的一些配置对象?

4

1 回答 1

0

尝试删除 withCredentials: true

Ext.Ajax.request({
    url: '/accounts/logout/',
    method: 'POST',
    success: function() {
        console.log('successfully logged out');
        window.location.href='/'
    }
});
于 2014-07-09T17:09:27.547 回答