Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
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
love_飞影
Neos
Commits
83aa5aaa
Commit
83aa5aaa
authored
Jul 24, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add mycard match api
parent
0676365d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
src/api/index.ts
src/api/index.ts
+1
-0
src/api/mycard/index.ts
src/api/mycard/index.ts
+2
-0
src/api/mycard/match.ts
src/api/mycard/match.ts
+32
-0
No files found.
src/api/index.ts
View file @
83aa5aaa
export
*
from
"
./cards
"
;
export
*
from
"
./deck
"
;
export
*
from
"
./mycard
"
;
export
*
from
"
./ocgcore/idl/ocgcore
"
;
export
*
from
"
./ocgcore/ocgHelper
"
;
export
*
from
"
./strings
"
;
src/api/mycard/index.ts
0 → 100644
View file @
83aa5aaa
// Collection of APIs provided by MyCard
export
*
from
"
./match
"
;
src/api/mycard/match.ts
0 → 100644
View file @
83aa5aaa
import
axios
from
"
axios
"
;
const
API_URL
=
"
https://sapi.moecube.com:444/ygopro/match
"
;
interface
MatchInfo
{
ip
:
string
;
port
:
number
;
password
:
string
;
}
export
async
function
match
(
userName
:
string
,
extraId
:
number
,
arena
:
string
=
"
entertain
"
):
Promise
<
MatchInfo
|
undefined
>
{
const
headers
=
{
Authorization
:
"
Basic
"
+
btoa
(
userName
+
"
:
"
+
extraId
)
};
const
response
=
await
axios
.
post
(
API_URL
,
undefined
,
{
headers
:
headers
,
params
:
{
arena
,
// TODO: locale?
},
})
.
catch
((
error
)
=>
{
console
.
error
(
`match error:
${
error
}
`
);
return
undefined
;
});
return
response
?
JSON
.
parse
(
response
.
data
)
:
undefined
;
}
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