20 lines
450 B
Go
20 lines
450 B
Go
package route
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"goweb/core"
|
|
"goweb/middleware"
|
|
)
|
|
|
|
func initTestRoute(r *gin.RouterGroup) {
|
|
group := r.Group("/test", middleware.AuthorizeJWT())
|
|
|
|
group.GET("/pub", func(context *gin.Context) {
|
|
core.R(context).OkWithMessage("已登录且无需权限可访问")
|
|
})
|
|
|
|
group.GET("/hello", middleware.AuthorityVerify(), func(context *gin.Context) {
|
|
core.R(context).OkWithMessage("已登录且有权限")
|
|
})
|
|
}
|