fix: fix the auto login bug

parent 423a6ac7
...@@ -46,7 +46,6 @@ export class CleftbarComponent implements OnInit { ...@@ -46,7 +46,6 @@ export class CleftbarComponent implements OnInit {
clientX = 0; clientX = 0;
clientY = 0; clientY = 0;
TooltipPosition = 'above'; TooltipPosition = 'above';
auto: boolean;
static Reload() { static Reload() {
} }
...@@ -96,7 +95,7 @@ export class CleftbarComponent implements OnInit { ...@@ -96,7 +95,7 @@ export class CleftbarComponent implements OnInit {
this._http.get_my_asset_groups_assets() this._http.get_my_asset_groups_assets()
.subscribe(response => { .subscribe(response => {
this.HostGroups = response; this.HostGroups = response;
if (!this.auto) { if (!DataStore.autologin) {
this.autologin(); this.autologin();
} }
}); });
...@@ -132,7 +131,7 @@ export class CleftbarComponent implements OnInit { ...@@ -132,7 +131,7 @@ export class CleftbarComponent implements OnInit {
if (!tag) { if (!tag) {
this._layer.alert('Maybe you do not have permission on that host'); this._layer.alert('Maybe you do not have permission on that host');
} }
this.auto = true; DataStore.autologin = true;
} }
Connect(host) { Connect(host) {
......
...@@ -103,6 +103,7 @@ export let DataStore: { ...@@ -103,6 +103,7 @@ export let DataStore: {
loglevel: number; loglevel: number;
leftbarshow: boolean; leftbarshow: boolean;
windowsize: Array<number>; windowsize: Array<number>;
autologin: boolean;
} = { } = {
socket: io.connect(), socket: io.connect(),
Nav: [{}], Nav: [{}],
...@@ -113,6 +114,7 @@ export let DataStore: { ...@@ -113,6 +114,7 @@ export let DataStore: {
loglevel: 0, loglevel: 0,
leftbarshow: true, leftbarshow: true,
windowsize: [], windowsize: [],
autologin: false,
}; };
export let CSRF = ''; export let CSRF = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment