Browse Source

身份验证

master
超级管理员 3 years ago
parent
commit
d690693832
  1. 2
      identification/interceptor/identity.go
  2. 7
      initialization/route/initRoute.go

2
identification/interceptor/identity.go

@ -137,7 +137,7 @@ func VerifyUrl() gin.HandlerFunc {
// c.Abort() // c.Abort()
// return // return
// } // }
fmt.Printf("obj------>%v-----------act------->%v---systemClass------------>%v------------------context-------->%v-------->menuIdAry-------->%v-------->menuUrl-------->%v-------->err-------->%v\n", obj, act, systemClass, context.Role, menuIdAry, menuUrl, err) fmt.Printf("obj---url--->%v-----------act------->%v---systemClass------------>%v------------------context-------->%v-------->menuIdAry-------->%v-------->menuUrl-------->%v-------->err-------->%v\n", obj, act, systemClass, context.Role, menuIdAry, menuUrl, err)
//此功能暂时不开启 //此功能暂时不开启
// if publicmethod.IsInTrue[string](obj, menuUrl) == false { // if publicmethod.IsInTrue[string](obj, menuUrl) == false {
// response.FailWithDetailed(gin.H{"reload": false, "code": 403}, "对不起!你没有访问此功能的权限!", c) // response.FailWithDetailed(gin.H{"reload": false, "code": 403}, "对不起!你没有访问此功能的权限!", c)

7
initialization/route/initRoute.go

@ -69,9 +69,6 @@ func InitialRouter() *gin.Engine {
bookimgRouterApi := apirouter.RouterGroupEntry.BookImg bookimgRouterApi := apirouter.RouterGroupEntry.BookImg
bookimgRouterApi.RouterGroup(VerifyIdentity) bookimgRouterApi.RouterGroup(VerifyIdentity)
//系统授权
systemAuthorizingApi := apirouter.RouterGroupEntry.Empowerouter
systemAuthorizingApi.RouterGroup(VerifyIdentity) //系统授权
} }
//验证身份接口 无需鉴权Url(主要web端使用) //验证身份接口 无需鉴权Url(主要web端使用)
VerifyIdentityWeb := router.Group("") VerifyIdentityWeb := router.Group("")
@ -87,6 +84,10 @@ func InitialRouter() *gin.Engine {
//系统权限设置 //系统权限设置
systemPowerPcApi := apirouter.RouterGroupEntry.SystemPowerRouter systemPowerPcApi := apirouter.RouterGroupEntry.SystemPowerRouter
systemPowerPcApi.RouterGroupPc(VerifyIdentityWeb) //web端 systemPowerPcApi.RouterGroupPc(VerifyIdentityWeb) //web端
//系统授权
systemAuthorizingApi := apirouter.RouterGroupEntry.Empowerouter
systemAuthorizingApi.RouterGroup(VerifyIdentityWeb) //系统授权
} }
//Token身份验证 //Token身份验证
VerifyIdentityToken := router.Group("") VerifyIdentityToken := router.Group("")

Loading…
Cancel
Save