提交 aa6821e6 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

增加开发者模式 配置文件env 修改为develop就可跳过鉴权

上级 f81bffc2
......@@ -33,7 +33,7 @@ redis:
# system configuration
system:
use-multipoint: false
env: 'develop'
env: 'public' # Change to "develop" to skip authentication for development mode
addr: 8888
# captcha configuration
......
package middleware
import (
"gin-vue-admin/global"
"gin-vue-admin/global/response"
"gin-vue-admin/model/request"
"gin-vue-admin/service"
......@@ -20,7 +21,7 @@ func CasbinHandler() gin.HandlerFunc {
sub := waitUse.AuthorityId
e := service.Casbin()
//判断策略中是否存在
if e.Enforce(sub, obj, act) {
if global.GVA_CONFIG.System.Env == "develop" || e.Enforce(sub, obj, act) {
c.Next()
} else {
response.Result(response.ERROR, gin.H{}, "权限不足", c)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册