feat: batch update with laisky's one-api

This commit is contained in:
Laisky.Cai
2025-03-20 10:43:14 +00:00
parent 761ee32d19
commit b2d6aa783b
35 changed files with 479 additions and 108 deletions

View File

@@ -6,13 +6,13 @@ import (
"html/template"
"log"
"net"
"net/http"
"os/exec"
"runtime"
"strconv"
"strings"
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/common/random"
)
@@ -32,6 +32,14 @@ func OpenBrowser(url string) {
}
}
// RespondError sends a JSON response with a success status and an error message.
func RespondError(c *gin.Context, err error) {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": err.Error(),
})
}
func GetIp() (ip string) {
ips, err := net.InterfaceAddrs()
if err != nil {