update: allow cors

This commit is contained in:
Sakurasan
2024-11-17 22:32:14 +08:00
parent 4b60e17fec
commit 78e3be4575
4 changed files with 8 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ import (
"os"
"github.com/duke-git/lancet/v2/fileutil"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"gorm.io/gorm"
@@ -166,7 +167,7 @@ func main() {
// 初始化用户
r.POST("/1/users/init", team.Handleinit)
r.Any("/v1/*proxypath", router.HandleProxy)
r.Any("/v1/*proxypath", cors.Default(), router.HandleProxy)
// r.POST("/v1/chat/completions", router.HandleProy)
// r.GET("/v1/models", router.HandleProy)