fix: base64

parent 50241b78
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
"@angular/platform-browser-dynamic": "5.2.0", "@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0", "@angular/router": "5.2.0",
"animate.css": "^3.5.2", "animate.css": "^3.5.2",
"base64-js": "^1.2.1",
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
"bootstrap": "^4.0.0-beta.3", "bootstrap": "^4.0.0-beta.3",
"clipboard": "^1.7.1", "clipboard": "^1.7.1",
......
...@@ -3,7 +3,6 @@ import {DomSanitizer} from '@angular/platform-browser'; ...@@ -3,7 +3,6 @@ import {DomSanitizer} from '@angular/platform-browser';
import {NavList} from '../../ControlPage/control/control.component'; import {NavList} from '../../ControlPage/control/control.component';
import {User} from '../../globals'; import {User} from '../../globals';
import {HttpService, LogService} from '../../app.service'; import {HttpService, LogService} from '../../app.service';
import * as Base64 from 'base64-js/base64js.min';
@Component({ @Component({
selector: 'app-element-iframe', selector: 'app-element-iframe',
...@@ -25,7 +24,7 @@ export class ElementIframeComponent implements OnInit { ...@@ -25,7 +24,7 @@ export class ElementIframeComponent implements OnInit {
// /guacamole/api/tokens will redirect to http://guacamole/api/tokens // /guacamole/api/tokens will redirect to http://guacamole/api/tokens
this._http.get_guacamole_token(User.name, this.host.id, this.userid).subscribe( this._http.get_guacamole_token(User.name, this.host.id, this.userid).subscribe(
data => { data => {
const base = Base64.encode(this.host.hostname + '\0' + 'c' + '\0' + 'jumpserver'); const base = window.btoa(this.host.hostname + '\0' + 'c' + '\0' + 'jumpserver');
// /guacamole/client will redirect to http://guacamole/#/client // /guacamole/client will redirect to http://guacamole/#/client
this.target = document.location.origin + this.target = document.location.origin +
'/guacamole/client/' + base + '?token=' + data['authToken']; '/guacamole/client/' + base + '?token=' + data['authToken'];
......
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