Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mycard Mobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mycard Mobile
Commits
b8e21d78
Commit
b8e21d78
authored
Jul 22, 2017
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logout
parent
960d3fb7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
src/app/auth.guard.ts
src/app/auth.guard.ts
+1
-1
src/app/lobby/lobby.component.html
src/app/lobby/lobby.component.html
+1
-0
src/app/login.service.ts
src/app/login.service.ts
+13
-1
No files found.
src/app/auth.guard.ts
View file @
b8e21d78
...
...
@@ -19,7 +19,7 @@ export class AuthGuard implements CanActivateChild {
this
.
login
.
callback
(
token
);
return
true
;
}
else
{
this
.
login
.
login
(
);
location
.
replace
(
this
.
login
.
login
()
);
return
false
;
}
...
...
src/app/lobby/lobby.component.html
View file @
b8e21d78
...
...
@@ -19,6 +19,7 @@
<md-icon>
add
</md-icon>
</button>
<md-menu
#menu
="
mdMenu
"
>
<a
[href]=
"login.logout()"
md-menu-item
>
切换用户
</a>
<button
md-menu-item
>
大厅版本 {{version}}
</button>
</md-menu>
</md-toolbar>
...
...
src/app/login.service.ts
View file @
b8e21d78
...
...
@@ -41,7 +41,19 @@ export class LoginService {
// );
// console.log(Buffer.from(new TextDecoder().decode(sign)).toString('hex'));
// params.set('sig', crypto.createHmac('sha256', 'zsZv6LXHDwwtUAGa').update(payload).digest('hex'));
return
location
.
replace
(
url
.
toString
());
return
url
.
toString
();
}
logout
()
{
let
params
=
new
URLSearchParams
();
params
.
set
(
'
return_sso_url
'
,
location
.
href
);
let
payload
=
Buffer
.
from
(
params
.
toString
()).
toString
(
'
base64
'
);
let
url
=
new
URL
(
'
https://accounts.moecube.com/signin
'
);
params
=
url
[
'
searchParams
'
];
params
.
set
(
'
sso
'
,
payload
);
return
url
.
toString
();
}
callback
(
token
:
string
)
{
...
...
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