Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
luna
Commits
b5651bef
Commit
b5651bef
authored
May 22, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 设置guacamole注册申请的token
parent
e1a91142
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
guacamole.component.ts
src/app/elements/guacamole/guacamole.component.ts
+4
-1
globals.ts
src/app/globals.ts
+3
-1
No files found.
src/app/elements/guacamole/guacamole.component.ts
View file @
b5651bef
...
...
@@ -63,11 +63,14 @@ export class ElementGuacamoleComponent implements OnInit {
NavList
.
List
[
this
.
index
].
Rdp
=
this
.
el
.
nativeElement
;
return
null
;
}
if
(
!
DataStore
.
guacamole_token
)
{
const
now
=
new
Date
();
const
nowTime
=
now
.
getTime
()
/
1000
;
if
(
!
DataStore
.
guacamole_token
||
nowTime
-
DataStore
.
guacamole_token_time
>
3600
)
{
this
.
_http
.
get_guacamole_token
(
User
.
id
,
''
).
subscribe
(
data
=>
{
// /guacamole/client will redirect to http://guacamole/#/client
DataStore
.
guacamole_token
=
data
[
'authToken'
];
DataStore
.
guacamole_token_time
=
nowTime
;
this
.
registerHost
();
},
error
=>
{
...
...
src/app/globals.ts
View file @
b5651bef
...
...
@@ -91,6 +91,7 @@ export let DataStore: {
windowsize
:
Array
<
number
>
;
autologin
:
boolean
;
guacamole_token
:
string
;
guacamole_token_time
:
number
;
}
=
{
socket
:
io
.
connect
(),
Nav
:
[{}],
...
...
@@ -102,7 +103,8 @@ export let DataStore: {
leftbarshow
:
true
,
windowsize
:
[],
autologin
:
false
,
guacamole_token
:
''
guacamole_token
:
''
,
guacamole_token_time
:
0
};
export
let
CSRF
=
''
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment