diff --git a/api/channel/v1/channel.go b/api/channel/v1/channel.go index e740cf6..9821bde 100644 --- a/api/channel/v1/channel.go +++ b/api/channel/v1/channel.go @@ -12,7 +12,7 @@ type ChannelList struct { } type GetChannelReq struct { - g.Meta `path:"/channel" method:"get" tags:"Channel" summary:"获取单个频道"` + g.Meta `path:"/channel" method:"post" tags:"Channel" summary:"获取单个频道"` Id int `v:"required|min:1#频道ID不能为空|频道ID不能小于1" dc:"频道ID"` UserId int `v:"required|min:90000000|max:99999999#用户ID不能为空|用户ID不能小于90000000|用户ID不能大于99999999" dc:"用户ID"` FlagType int `v:"min:1|max:2#类型不能小于1|类型不能大于2" dc:"列表类型"` diff --git a/api/live/v1/live.go b/api/live/v1/live.go index c080051..414947a 100644 --- a/api/live/v1/live.go +++ b/api/live/v1/live.go @@ -12,7 +12,7 @@ type Live struct { } type GetLiveReq struct { - g.Meta `path:"/live" method:"get" tags:"Live" summary:"获取直播列表"` + g.Meta `path:"/live" method:"post" tags:"Live" summary:"获取直播列表"` UserId int `v:"required|min:90000000|max:99999999#用户ID不能为空|用户ID不能小于90000000|用户ID不能大于99999999" dc:"用户ID"` } diff --git a/main.go b/main.go index 8444d45..e003169 100644 --- a/main.go +++ b/main.go @@ -27,9 +27,9 @@ func main() { // 创建CORS中间件,配置允许的源等信息 c := cors.New(cors.Options{ - AllowedOrigins: []string{"http://localhost:5173"}, + AllowedOrigins: []string{"http://192.168.9.*:5173"}, AllowedMethods: []string{"GET", "POST", "PUT", "DELETE"}, - AllowedHeaders: []string{"Content-Type"}, + AllowedHeaders: []string{"Content-Type, Authorization"}, }) handler := c.Handler(mux) log.Fatal(http.ListenAndServe(":8080", handler))