mirror of https://gitee.com/bigwinds/arangodb
js/collections/arangoQueries.js
This commit is contained in:
parent
cc440aaaaa
commit
d6f62ac834
|
@ -6,12 +6,18 @@
|
|||
window.ArangoQueries = Backbone.Collection.extend({
|
||||
|
||||
initialize: function(models, options) {
|
||||
if (options.activeUser) {
|
||||
this.activeUser = options.activeUser;
|
||||
var result;
|
||||
$.ajax("whoAmI", {async:false}).done(
|
||||
function(data) {
|
||||
result = data.name;
|
||||
}
|
||||
else {
|
||||
);
|
||||
this.activeUser = result;
|
||||
|
||||
if (this.activeUser === 0 || this.activeUser === undefined || this.activeUser === null) {
|
||||
this.activeUser = "root";
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
url: '/_api/user/',
|
||||
|
|
Loading…
Reference in New Issue