Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
syntax_j
mycard
Commits
6ec19f15
Commit
6ec19f15
authored
Oct 26, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login
parent
6a532662
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
13 deletions
+26
-13
app/login.component.ts
app/login.component.ts
+6
-0
app/login.service.ts
app/login.service.ts
+18
-11
app/mycard.component.html
app/mycard.component.html
+2
-2
No files found.
app/login.component.ts
View file @
6ec19f15
...
@@ -28,6 +28,12 @@ export class LoginComponent {
...
@@ -28,6 +28,12 @@ export class LoginComponent {
'
sig
'
:
crypto
.
createHmac
(
'
sha256
'
,
'
zsZv6LXHDwwtUAGa
'
).
update
(
payload
).
digest
(
'
hex
'
)
'
sig
'
:
crypto
.
createHmac
(
'
sha256
'
,
'
zsZv6LXHDwwtUAGa
'
).
update
(
payload
).
digest
(
'
hex
'
)
});
});
this
.
url
=
"
https://ygobbs.com/session/sso_provider?
"
+
request
;
this
.
url
=
"
https://ygobbs.com/session/sso_provider?
"
+
request
;
if
(
this
.
loginService
.
logging_out
)
{
let
request
=
querystring
.
stringify
({
'
redirect
'
:
this
.
url
});
this
.
url
=
"
https://ygobbs.com/logout?
"
+
request
;
}
}
}
return_sso
(
return_url
)
{
return_sso
(
return_url
)
{
...
...
app/login.service.ts
View file @
6ec19f15
...
@@ -2,21 +2,26 @@
...
@@ -2,21 +2,26 @@
* Created by zh99998 on 2016/10/25.
* Created by zh99998 on 2016/10/25.
*/
*/
import
{
Injectable
}
from
"
@angular/core
"
;
import
{
Injectable
}
from
"
@angular/core
"
;
import
{
Http
}
from
"
@angular/http
"
;
/*
interface User {
interface
User
{
admin: boolean;
admin
:
boolean
;
avatar_url: string;
avatar_url
:
string
;
email: string;
email
:
string
;
external_id: number;
external_id
:
number
;
moderator: boolean;
moderator
:
boolean
;
name: string;
name
:
string
;
username: string;
username
:
string
;
}*/
}
@
Injectable
()
@
Injectable
()
export
class
LoginService
{
export
class
LoginService
{
user
=
JSON
.
parse
(
localStorage
.
getItem
(
'
login
'
));
user
:
User
=
JSON
.
parse
(
localStorage
.
getItem
(
'
login
'
));
logging_out
;
constructor
(
private
http
:
Http
)
{
}
login
(
user
)
{
login
(
user
)
{
this
.
user
=
user
;
this
.
user
=
user
;
...
@@ -24,7 +29,9 @@ export class LoginService {
...
@@ -24,7 +29,9 @@ export class LoginService {
}
}
logout
()
{
logout
()
{
this
.
logging_out
=
true
;
this
.
user
=
null
;
this
.
user
=
null
;
localStorage
.
removeItem
(
'
login
'
);
localStorage
.
removeItem
(
'
login
'
);
}
}
}
}
\ No newline at end of file
app/mycard.component.html
View file @
6ec19f15
...
@@ -19,10 +19,10 @@
...
@@ -19,10 +19,10 @@
<div
class=
"navbar-right"
>
<div
class=
"navbar-right"
>
<div
id=
"user"
*ngIf=
"loginService.user"
>
<div
id=
"user"
*ngIf=
"loginService.user"
>
<a
href=
"#forum"
class=
"require-login profile"
>
<a
href=
"#forum"
class=
"require-login profile"
>
<img
id=
"avatar"
src=
"https://ygobbs.com/letter_avatar_proxy/v2/letter/a/e47774/36.png
"
alt=
"image"
>
<img
id=
"avatar"
[src]=
"loginService.user.avatar_url
"
alt=
"image"
>
</a>
</a>
<a
href=
"#forum"
class=
"require-login profile item"
id=
"username"
></a>
<a
href=
"#forum"
class=
"require-login profile item"
id=
"username"
></a>
<a
(click)=
"
currentPage='login'
"
href=
"#ygopro"
id=
"logout"
class=
"require-login item"
>
切换账号
</a>
<a
(click)=
"
loginService.logout()
"
href=
"#ygopro"
id=
"logout"
class=
"require-login item"
>
切换账号
</a>
<a
(click)=
"refresh()"
href=
"#ygopro"
id=
"refresh"
class=
"item"
>
刷新
</a>
<a
(click)=
"refresh()"
href=
"#ygopro"
id=
"refresh"
class=
"item"
>
刷新
</a>
</div>
</div>
<div
id=
"window-buttons"
[class.darwin]=
"platform == 'darwin'"
>
<div
id=
"window-buttons"
[class.darwin]=
"platform == 'darwin'"
>
...
...
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