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
33d8c3f9
Commit
33d8c3f9
authored
Apr 03, 2023
by
huangzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 余额自定义异常处理开关
parent
67e6b14c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
Payment.ts
packages/toolkit/src/Payment/Payment.ts
+10
-9
No files found.
packages/toolkit/src/Payment/Payment.ts
View file @
33d8c3f9
...
...
@@ -90,22 +90,23 @@ export class Payment {
}
}
async
getBalance
():
Promise
<
number
|
BalanceReturns
>
{
//isHandleErr 是否要自定义处理异常
async
getBalance
(
isHandleErr
:
Boolean
):
Promise
<
number
|
BalanceReturns
>
{
try
{
const
{
data
:
res
}
=
await
requestForPhp
.
post
(
MY_BALANCE
,
{
balance
:
1
})
if
(
res
.
data
&&
res
.
data
.
balance
)
{
this
.
balance
=
Number
(
res
.
data
.
balance
)
}
if
(
res
.
msg
===
'success'
){
return
this
.
balance
}
return
{
success
:
false
,
msg
:
res
.
msg
,
code
:
res
.
code
if
(
isHandleErr
&&
res
.
msg
!==
'success'
){
return
{
success
:
false
,
msg
:
res
.
msg
,
code
:
res
.
code
}
}
return
this
.
balance
}
catch
(
err
)
{
return
{
success
:
false
}
return
isHandleErr
?
{
success
:
false
}
:
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