未验证 提交 b419bc6f 编写于 作者: R rainyan 提交者: GitHub

Merge pull request #50 from flipped-aurora/gin-vue-admin_v2_dev

add /web/dist to .gitignore
.idea/
/web/node_modules
/web/dist
.DS_Store
......
......@@ -33,12 +33,12 @@ redis:
# system configuration
system:
use-multipoint: false
env: 'develop'
env: 'public' # Change to "develop" to skip authentication for development mode
addr: 8888
# captcha configuration
captcha:
key-long: 6
key-long: 4
img-width: 120
img-height: 40
......
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.
先完成此消息的编辑!
想要评论请 注册