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
xiaoye
mycard
Commits
f7135db6
Commit
f7135db6
authored
Jul 15, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add timeout for loading apps.json
parent
0c6ffd91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
app/apps.service.ts
app/apps.service.ts
+4
-1
No files found.
app/apps.service.ts
View file @
f7135db6
...
@@ -84,7 +84,9 @@ export class AppsService {
...
@@ -84,7 +84,9 @@ export class AppsService {
let
appsURL
=
'
https://api.mycard.moe/apps.json
'
;
let
appsURL
=
'
https://api.mycard.moe/apps.json
'
;
let
keysURL
=
'
https://api.mycard.moe/keys
'
;
let
keysURL
=
'
https://api.mycard.moe/keys
'
;
try
{
try
{
let
data
=
await
this
.
http
.
get
(
appsURL
).
map
((
response
)
=>
response
.
json
()).
toPromise
();
let
data
=
await
this
.
http
.
get
(
appsURL
)
.
timeout
(
5000
)
.
map
((
response
)
=>
response
.
json
()).
toPromise
();
let
keys_data
=
await
this
.
http
.
get
(
keysURL
,
{
let
keys_data
=
await
this
.
http
.
get
(
keysURL
,
{
search
:
{
search
:
{
user_id
:
this
.
loginService
.
user
.
email
user_id
:
this
.
loginService
.
user
.
email
...
@@ -102,6 +104,7 @@ export class AppsService {
...
@@ -102,6 +104,7 @@ export class AppsService {
console
.
error
(
e
);
console
.
error
(
e
);
let
data
=
localStorage
.
getItem
(
'
apps_json
'
);
let
data
=
localStorage
.
getItem
(
'
apps_json
'
);
if
(
data
)
{
if
(
data
)
{
new
Notification
(
'
MyCard
'
,
{
body
:
'
读取最新游戏列表失败...
'
});
this
.
apps
=
this
.
loadAppsList
(
JSON
.
parse
(
data
!
));
this
.
apps
=
this
.
loadAppsList
(
JSON
.
parse
(
data
!
));
}
else
{
}
else
{
alert
(
'
读取游戏列表失败,可能是网络不通
'
);
alert
(
'
读取游戏列表失败,可能是网络不通
'
);
...
...
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