更新错误提示
This commit is contained in:
@@ -59,7 +59,8 @@ func main() {
|
||||
// 初始化用户
|
||||
r.POST("/1/users/init", router.Handleinit)
|
||||
|
||||
r.Any("/v1/*proxypath", router.HandleProy)
|
||||
// r.Any("/v1/*proxypath", router.HandleProy)
|
||||
r.Match([]string{http.MethodGet, http.MethodPost}, "/v1/*proxypath", router.HandleProy)
|
||||
|
||||
// r.POST("/v1/chat/completions", router.HandleProy)
|
||||
// r.GET("/v1/models", router.HandleProy)
|
||||
|
||||
@@ -358,7 +358,9 @@ func HandleProy(c *gin.Context) {
|
||||
req.Header = c.Request.Header
|
||||
if localuser {
|
||||
if store.KeysCache.ItemCount() == 0 {
|
||||
c.JSON(http.StatusOK, gin.H{"error": "No Api-Key Available"})
|
||||
c.JSON(http.StatusBadGateway, gin.H{"error": gin.H{
|
||||
"message": "No Api-Key Available",
|
||||
}})
|
||||
return
|
||||
}
|
||||
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", store.FromKeyCacheRandomItem()))
|
||||
|
||||
Reference in New Issue
Block a user