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
138fbc82
Commit
138fbc82
authored
Jan 22, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update small
parent
7b6edba2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
src/api/cards.ts
src/api/cards.ts
+10
-1
src/ui/WaitRoom.tsx
src/ui/WaitRoom.tsx
+4
-0
No files found.
src/api/cards.ts
View file @
138fbc82
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
../middleware/sqlite
"
;
export
interface
CardMeta
{
export
interface
CardMeta
{
id
:
number
;
id
:
number
;
...
@@ -42,7 +43,15 @@ export interface CardMeta {
...
@@ -42,7 +43,15 @@ export interface CardMeta {
* @returns 卡片数据
* @returns 卡片数据
*
*
* */
* */
export
async
function
fetchCard
(
id
:
number
):
Promise
<
CardMeta
>
{
export
async
function
fetchCard
(
id
:
number
,
local
?:
boolean
):
Promise
<
CardMeta
>
{
if
(
local
)
{
return
await
sqliteMiddleWare
({
cmd
:
sqliteCmd
.
SELECT
,
payload
:
id
}).
then
(
(
res
)
=>
(
res
?
res
:
{
id
,
data
:
{},
text
:
{}
})
);
}
const
res
=
await
axios
.
get
<
CardMeta
>
(
"
http://localhost:3030/cards/
"
+
id
);
const
res
=
await
axios
.
get
<
CardMeta
>
(
"
http://localhost:3030/cards/
"
+
id
);
return
res
.
data
;
return
res
.
data
;
...
...
src/ui/WaitRoom.tsx
View file @
138fbc82
...
@@ -21,6 +21,7 @@ import {
...
@@ -21,6 +21,7 @@ import {
sendHsStart
,
sendHsStart
,
}
from
"
../api/ocgcore/ocgHelper
"
;
}
from
"
../api/ocgcore/ocgHelper
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
../middleware/socket
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
../middleware/socket
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
../middleware/sqlite
"
;
import
{
Button
}
from
"
antd
"
;
import
{
Button
}
from
"
antd
"
;
const
READY_STATE
=
"
ready
"
;
const
READY_STATE
=
"
ready
"
;
...
@@ -47,6 +48,9 @@ export default function WaitRoom() {
...
@@ -47,6 +48,9 @@ export default function WaitRoom() {
},
},
});
});
}
}
// 初始化sqlite
sqliteMiddleWare
({
cmd
:
sqliteCmd
.
INIT
});
},
[]);
},
[]);
const
joined
=
useAppSelector
(
selectJoined
);
const
joined
=
useAppSelector
(
selectJoined
);
...
...
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