-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2117 from goodrain/V6.1
feat: v6.1.0 release
- Loading branch information
Showing
12 changed files
with
609 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package api_routers | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/gin-gonic/gin" | ||
) | ||
|
||
type RouteStruct struct { | ||
// Add any necessary fields here | ||
} | ||
|
||
func (r *RouteStruct) SetRoutes(engine *gin.Engine) { | ||
// 应用 CORS 中间件到所有路由 | ||
engine.Use(func(c *gin.Context) { | ||
controller.CORS(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
c.Next() | ||
})).ServeHTTP(c.Writer, c.Request) | ||
}) | ||
|
||
// ... 其余路由注册代码 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.