Sfoglia il codice sorgente

fix: restore clean go test baseline

master
fengsilin 2 settimane fa
parent
commit
7ecedd8e57
3 ha cambiato i file con 18 aggiunte e 6 eliminazioni
  1. +2
    -0
      .gitignore
  2. +5
    -6
      controller/pricing.go
  3. +11
    -0
      web/dist/index.html

+ 2
- 0
.gitignore Vedi File

@@ -8,6 +8,8 @@ build
*.db-journal
logs
web/dist
!web/dist/
!web/dist/index.html
.env
one-api
new-api


+ 5
- 6
controller/pricing.go Vedi File

@@ -177,15 +177,14 @@ func formatDiscount(ratio float64) string {
if ratio <= 0 {
return "免费"
}
discount := int(math.Round(ratio * 10))
if discount >= 10 {
rawDiscount := math.Round(ratio*100) / 10
if rawDiscount >= 10 {
return ""
}
remainder := int(math.Round(ratio*100)) % 10
if remainder == 0 {
return fmt.Sprintf("%d折", discount)
if rawDiscount == math.Trunc(rawDiscount) {
return fmt.Sprintf("%.0f折", rawDiscount)
}
return fmt.Sprintf("%.1f折", ratio*10)
return fmt.Sprintf("%.1f折", rawDiscount)
}

func ResetModelRatio(c *gin.Context) {


+ 11
- 0
web/dist/index.html Vedi File

@@ -0,0 +1,11 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>new-api</title>
</head>
<body>
<div id="root">Frontend assets are not built in this checkout.</div>
</body>
</html>

Caricamento…
Annulla
Salva