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
5441828e
Commit
5441828e
authored
Aug 28, 2017
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updateUser
parent
bc508048
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
36 deletions
+41
-36
package.json
package.json
+1
-1
src/app/app.module.ts
src/app/app.module.ts
+4
-3
src/app/login.service.ts
src/app/login.service.ts
+7
-0
src/app/ygopro.d.ts
src/app/ygopro.d.ts
+29
-0
src/app/ygopro.service.ts
src/app/ygopro.service.ts
+0
-32
No files found.
package.json
View file @
5441828e
{
"name"
:
"mycard-mobile"
,
"version"
:
"1.0.1
8
"
,
"version"
:
"1.0.1
9
"
,
"license"
:
"UNLISENCED"
,
"scripts"
:
{
"ng"
:
"ng"
,
...
...
src/app/app.module.ts
View file @
5441828e
...
...
@@ -36,6 +36,7 @@ import { StorageService } from './storage.service';
import
{
ToolbarComponent
}
from
'
./toolbar/toolbar.component
'
;
import
{
WatchComponent
}
from
'
./watch/watch.component
'
;
import
{
WindbotComponent
}
from
'
./windbot/windbot.component
'
;
import
'
./ygopro.d
'
;
import
{
YGOProService
}
from
'
./ygopro.service
'
;
@
NgModule
({
...
...
@@ -48,7 +49,7 @@ import { YGOProService } from './ygopro.service';
WindbotComponent
,
WatchComponent
,
ToolbarComponent
,
ResultDialogComponent
,
ResultDialogComponent
],
imports
:
[
BrowserModule
,
...
...
@@ -74,11 +75,11 @@ import { YGOProService } from './ygopro.service';
ReactiveFormsModule
,
JsonpModule
,
MdMenuModule
,
MdProgressSpinnerModule
,
MdProgressSpinnerModule
],
providers
:
[
YGOProService
,
StorageService
],
bootstrap
:
[
AppComponent
],
entryComponents
:
[
MatchDialogComponent
,
ResultDialogComponent
]
,
entryComponents
:
[
MatchDialogComponent
,
ResultDialogComponent
]
})
export
class
AppModule
{
}
src/app/login.service.ts
View file @
5441828e
...
...
@@ -60,6 +60,13 @@ export class LoginService {
this
.
token
=
token
;
this
.
user
=
<
any
>
fromPairs
(
Array
.
from
(
new
URLSearchParams
(
Buffer
.
from
(
token
,
'
base64
'
).
toString
())));
localStorage
.
setItem
(
'
login
'
,
token
);
if
(
window
.
ygopro
)
{
try
{
window
.
ygopro
.
updateUser
(
this
.
user
.
username
,
this
.
user
.
avatar_url
,
this
.
user
.
email
);
}
catch
(
error
)
{
console
.
error
(
error
);
}
}
}
avatar
(
username
:
string
)
{
...
...
src/app/ygopro.d.ts
0 → 100644
View file @
5441828e
interface
Window
{
ygopro
:
{
// 加入房间
join
(
address
:
string
,
port
:
number
,
username
:
string
,
password
:
string
):
void
// 编辑卡组
edit_deck
():
void
// 观看录像,进入观看录像界面
watch_replay
():
void
// 残局模式
puzzle_mode
():
void
openDrawer
():
void
backHome
():
void
share
(
text
:
string
):
void
updateUser
(
name
:
string
,
avatar
:
string
,
status
:
string
):
void
readFile
(
path
:
string
):
string
writeFile
(
path
:
string
,
data
:
string
):
string
readdir
(
path
:
string
):
string
unlink
(
path
:
string
):
boolean
getFileLastModified
(
path
:
string
):
number
setFileLastModified
(
path
:
string
,
time
:
number
):
void
};
}
src/app/ygopro.service.ts
View file @
5441828e
...
...
@@ -460,35 +460,3 @@ export class RoomListDataSource extends DataSource<any> {
}
}
declare
global
{
interface
Window
{
ygopro
:
{
// 加入房间
join
(
address
:
string
,
port
:
number
,
username
:
string
,
password
:
string
):
void
// 编辑卡组
edit_deck
():
void
// 观看录像,进入观看录像界面
watch_replay
():
void
// 残局模式
puzzle_mode
():
void
openDrawer
():
void
backHome
():
void
share
(
text
:
string
):
void
readFile
(
path
:
string
):
string
writeFile
(
path
:
string
,
data
:
string
):
string
readdir
(
path
:
string
):
string
unlink
(
path
:
string
):
boolean
getFileLastModified
(
path
:
string
):
number
setFileLastModified
(
path
:
string
,
time
:
number
):
void
};
}
}
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