Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이재용
/
TFT_My_Galaxy
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이재용
2020-06-28 22:49:58 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
aa998ff8de461821b39889a124b4ef2b2c6d0e57
aa998ff8
1 parent
36b53672
callback 으로 값 전달 및 승률 출력 형식 변경
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
TFT_My_Galaxy/user/userinfo.js
TFT_My_Galaxy/user/userinfo.js
View file @
aa998ff
const
searchGameInfo
=
require
(
'../api/api'
);
var
result
=
{};
var
urlencode
=
require
(
"urlencode"
)
var
urlencode
=
require
(
"urlencode"
);
const
search
=
require
(
'../api/api'
);
var
local_puuid
;
result
.
userInfo
=
function
(
name
)
{
var
need_data
;
result
.
userInfo
=
function
(
name
,
callback
)
{
var
encode_name
=
urlencode
(
name
)
searchGameInfo
.
getPuuid
(
encode_name
).
then
(
puuid
=>
{
local_puuid
=
puuid
...
...
@@ -62,7 +63,7 @@ result.userInfo = function(name) {
}
var
result
=
{}
var
result
=
[]
rest_dic
=
all_map_count
for
(
key
in
all_map_count
)
{
...
...
@@ -70,7 +71,9 @@ result.userInfo = function(name) {
{
if
(
key
==
key2
)
{
console
.
log
(
key
+
" 승률: "
+
top_map_count
[
key
]
/
all_map_count
[
key
]
+
" 판 수: ("
+
top_map_count
[
key
]
+
"/"
+
all_map_count
[
key
]
+
")"
)
a
=
key
+
" 승률: "
+
(
top_map_count
[
key
]
/
all_map_count
[
key
]).
toFixed
(
3
)
+
" 판 수: ("
+
top_map_count
[
key
]
+
"/"
+
all_map_count
[
key
]
+
")"
result
.
push
(
a
)
delete
rest_dic
[
key
]
}
...
...
@@ -78,10 +81,13 @@ result.userInfo = function(name) {
}
for
(
key
in
rest_dic
)
{
console
.
log
(
key
+
" 승률: 0 판 수: (0/"
+
all_map_count
[
key
]
+
")"
)
b
=
key
+
" 승률: 0 판 수: (0/"
+
all_map_count
[
key
]
+
")"
result
.
push
(
b
)
}
callback
(
result
);
});
//res.end("done");
};
module
.
exports
=
result
;
\ No newline at end of file
...
...
Please
register
or
login
to post a comment