Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
580ad97c
authored
Jun 03, 2026
by
feitianbubu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: convert usd amount by exchange rate in classic quota display
parent
b0ac0429
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
20 deletions
+6
-20
web/classic/src/helpers/render.jsx
+6
-20
No files found.
web/classic/src/helpers/render.jsx
View file @
580ad97c
...
@@ -1068,31 +1068,17 @@ export function getQuotaWithUnit(quota, digits = 6) {
...
@@ -1068,31 +1068,17 @@ export function getQuotaWithUnit(quota, digits = 6) {
return
(
quota
/
quotaPerUnit
).
toFixed
(
digits
);
return
(
quota
/
quotaPerUnit
).
toFixed
(
digits
);
}
}
// amount 为系统内部的美元值
export
function
renderQuotaWithAmount
(
amount
)
{
export
function
renderQuotaWithAmount
(
amount
)
{
const
quotaDisplayType
=
localStorage
.
getItem
(
'quota_display_type'
)
||
'USD'
;
const
{
symbol
,
rate
,
type
}
=
getCurrencyConfig
()
;
if
(
quotaDisplayT
ype
===
'TOKENS'
)
{
if
(
t
ype
===
'TOKENS'
)
{
return
renderNumber
(
renderUnitWithQuota
(
amount
));
return
renderNumber
(
renderUnitWithQuota
(
amount
));
}
}
const
numericAmount
=
Number
(
amount
);
const
numericAmount
=
Number
(
amount
);
const
formattedAmount
=
Number
.
isFinite
(
numericAmount
)
if
(
!
Number
.
isFinite
(
numericAmount
))
{
?
numericAmount
.
toFixed
(
2
)
return
symbol
+
amount
;
:
amount
;
if
(
quotaDisplayType
===
'CNY'
)
{
return
'¥'
+
formattedAmount
;
}
else
if
(
quotaDisplayType
===
'CUSTOM'
)
{
const
statusStr
=
localStorage
.
getItem
(
'status'
);
let
symbol
=
'¤'
;
try
{
if
(
statusStr
)
{
const
s
=
JSON
.
parse
(
statusStr
);
symbol
=
s
?.
custom_currency_symbol
||
symbol
;
}
}
catch
(
e
)
{}
return
symbol
+
formattedAmount
;
}
}
return
'$'
+
formattedAmount
;
return
symbol
+
(
numericAmount
*
rate
).
toFixed
(
2
)
;
}
}
/**
/**
...
...
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