chore: remove console logging & update balance rendering
This commit is contained in:
parent
2fde6839a0
commit
46464215ba
@ -62,7 +62,7 @@ type API2GPTUsageResponse struct {
|
||||
}
|
||||
|
||||
type APGC2DGPTUsageResponse struct {
|
||||
Grants interface{} `json:"grants"`
|
||||
//Grants interface{} `json:"grants"`
|
||||
Object string `json:"object"`
|
||||
TotalAvailable float64 `json:"total_available"`
|
||||
TotalGranted float64 `json:"total_granted"`
|
||||
@ -161,13 +161,11 @@ func updateChannelAPI2GPTBalance(channel *model.Channel) (float64, error) {
|
||||
func updateChannelAIGC2DBalance(channel *model.Channel) (float64, error) {
|
||||
url := "https://api.aigc2d.com/dashboard/billing/credit_grants"
|
||||
body, err := GetResponseBody("GET", url, channel, GetAuthHeader(channel.Key))
|
||||
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
response := APGC2DGPTUsageResponse{}
|
||||
err = json.Unmarshal(body, &response)
|
||||
fmt.Println(response)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ function renderBalance(type, balance) {
|
||||
case 12: // API2GPT
|
||||
return <span>¥{balance.toFixed(2)}</span>;
|
||||
case 13: // AIGC2D
|
||||
return <span>¥{(balance * 0.0021).toFixed(2)}</span>;
|
||||
return <span>{renderNumber(balance)}</span>;
|
||||
default:
|
||||
return <span>不支持</span>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user