zhou.xiaoning 4 tahun lalu
induk
melakukan
64d962bd6a
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      permission_generator/main.go

+ 3 - 3
permission_generator/main.go

@@ -121,7 +121,7 @@ func buildSQL(datas []interface{}, parentCode string, level int) string {
 			// 递归
 			sub := data["children"].([]interface{})
 			if len(sub) > 0 {
-				sql += buildSQL(data["children"].([]interface{}), data["code"].(string), level+1)
+				sql += buildSQL(data["children"].([]interface{}), data["rulekey"].(string), level+1)
 			}
 
 			if level == 1 {
@@ -167,10 +167,10 @@ func buildPCWEBSQL(datas []interface{}, parentCode string, level int) string {
 
 			// 递归
 			if data["auth"] != nil {
-				sql += buildPCWEBSQL(data["auth"].([]interface{}), data["code"].(string), level+1)
+				sql += buildPCWEBSQL(data["auth"].([]interface{}), data["rulekey"].(string), level+1)
 			}
 			if data["children"] != nil {
-				sql += buildPCWEBSQL(data["children"].([]interface{}), data["code"].(string), level+1)
+				sql += buildPCWEBSQL(data["children"].([]interface{}), data["rulekey"].(string), level+1)
 			}
 
 			if level == 1 {