Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-packages
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
许振钊
ydl-packages
Commits
c9385ddd
Commit
c9385ddd
authored
Apr 04, 2023
by
huangzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 余额错误
parent
5b53f0f6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+6
-8
No files found.
packages/toolkit/src/Payment/Payment.ts
View file @
c9385ddd
...
...
@@ -91,22 +91,20 @@ export class Payment {
}
//isHandleErr 是否要自定义处理异常
async
getBalance
(
isHandleErr
:
Boolean
):
Promise
<
number
|
BalanceReturns
>
{
async
getBalance
(
handleErr
:
(
err
:
BalanceReturns
)
=>
void
):
Promise
<
number
|
null
>
{
try
{
const
{
data
:
res
}
=
await
requestForPhp
.
post
(
MY_BALANCE
,
{
balance
:
1
})
if
(
res
.
data
&&
res
.
data
.
balance
)
{
this
.
balance
=
Number
(
res
.
data
.
balance
)
}
if
(
isHandleErr
&&
res
.
msg
!==
'success'
){
return
{
success
:
false
,
msg
:
res
.
msg
,
code
:
res
.
code
}
if
(
handleErr
&&
res
.
msg
!==
'success'
){
handleErr
&&
handleErr
(
res
)
return
null
}
return
this
.
balance
}
catch
(
err
)
{
return
isHandleErr
?
{
success
:
false
}
:
0
handleErr
&&
handleErr
({
success
:
false
})
return
!!
handleErr
?
null
:
0
}
}
getPayMethodList
(
totalAmount
:
number
)
{
...
...
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