Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
299795fb
Commit
299795fb
authored
May 20, 2021
by
gongguan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交分数接口增加防并发
parent
4f67af43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
game.service.ts
v2.0/src/service/common/game.service.ts
+14
-0
No files found.
v2.0/src/service/common/game.service.ts
View file @
299795fb
...
...
@@ -50,6 +50,20 @@ export default class GameService extends UserService {
userInfo
:
IUserInfo
,
joinInfo
:
IJoinRecord
)
{
const
gameResult
=
await
this
.
joindao
.
update
(
{
_id
:
id
,
$where
:
`this.status === 1`
},
{
$set
:
{
status
:
2
}
}
)
if
(
gameResult
!==
1
)
{
// 该局游戏实际已结束,有并发
return
{
data
:
1
}
}
const
{
duration
}
=
await
this
.
updateJoinRecord
(
id
,
score
,
userInfo
,
joinInfo
)
const
{
maxScore
,
totalScore
}
=
await
this
.
updateUserScore
(
score
,
userInfo
)
...
...
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