Fix problems modifying personal information,Upgrade route configuration format
This commit is contained in:
1 parent
e07cb22255
commit
c0b8199c36
18 files changed
+355
-244
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/pkg/jwtauth"
|
||||
jwt "go-admin/pkg/jwtauth"
|
||||
)
|
||||
|
||||
// 路由示例
|
||||
func InitExamplesRouter(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware) *gin.Engine {
|
||||
|
||||
// 无需认证的路由
|
||||
examplesNoCheckRoleRouter(r)
|
||||
// 需要认证的路由
|
||||
examplesCheckRoleRouter(r, authMiddleware)
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
// 无需认证的路由示例
|
||||
func examplesNoCheckRoleRouter(r *gin.Engine) {
|
||||
|
||||
//v1 := r.Group("/api/v1")
|
||||
//v1.GET("/examples/list", examples.apis)
|
||||
|
||||
}
|
||||
|
||||
// 需要认证的路由示例
|
||||
func examplesCheckRoleRouter(r *gin.Engine, authMiddleware *jwtauth.GinJWTMiddleware) {
|
||||
|
||||
//v1auth := r.Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||
//{
|
||||
// v1auth.GET("/examples/list", examples.apis)
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user