居然是你

开启xpack后, bigdesk无法访问

Elasticsearch | 作者 wushi | 发布于2019年11月22日 | 阅读数:1651

es是6.5.1,本来bigdesk还能用。但是集群启用xpack后就无法使用。
于是找到了这篇文章http://www.programmersought.co ... 6225/
修改bigdesk-master / _site / js / util / bigdesk_extension.js 
    sync: function(method, model, options) {
//options.dataType = 'jsonp';
options.url = this.getBaseUrl() + this.url();
// Append Authorization request header
// ZWxhc3RpYzpjaGFuZ2VtZQ ​​== is user: base64 encrypted value of the password
options.beforeSend = function (xhr) {
xhr.setRequestHeader('Authorization', 'Basic ZWxhc3RpYzpjaGFuZ2VtZQ==');
}
return Backbone.sync(method, model, options);
}

但是我修改后,依旧不能用,有没有大神指点一下
Backbone.Collection = Backbone.Collection.extend({
sync: function(method, model, options) {
// options.dataType = 'jsonp';
// options.url = this.getBaseUrl() + this.url();

//----------------------修改的地方
options.beforeSend = function (xhr) {
xhr.setRequestHeader('Authorization', 'Basic ZWxhc3RpYzoxMjM0NTY=');
}

//----------------------修改的地方
return Backbone.sync(method, model, options);
},
// Did not find much information about how to store metadata with collection.
// Direct set/get of property seems to work fine.
getBaseUrl: function() {
return this.baseUrl;
},
setBaseUrl: function(url) {
this.baseUrl = url;
},
initialize: function(models, options) {
if (options && options.baseUrl) {
this.setBaseUrl(options.baseUrl);
}
}
});

 
已邀请:

要回复问题请先登录注册