Ver código fonte

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

add /web/dist to .gitignore
rainyan 4 anos atrás
pai
commit
b419bc6fe2
3 arquivos alterados com 5 adições e 3 exclusões
  1. 1 0
      .gitignore
  2. 2 2
      server/config.yaml
  3. 2 1
      server/middleware/casbin_rcba.go

+ 1 - 0
.gitignore

@@ -1,5 +1,6 @@
 .idea/
 /web/node_modules
+/web/dist
 
 .DS_Store
 

+ 2 - 2
server/config.yaml

@@ -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
 

+ 2 - 1
server/middleware/casbin_rcba.go

@@ -1,6 +1,7 @@
 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)