From 8992fd6d3a1b742b94972343b1544b21791882b1 Mon Sep 17 00:00:00 2001 From: hoteas <等> Date: Thu, 11 Aug 2022 10:18:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code.go | 26 +++++++++++++++++--------- example/config/config.json | 6 +++--- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/code.go b/code.go index aa1987a..1a8ab34 100644 --- a/code.go +++ b/code.go @@ -776,16 +776,24 @@ var TptProject = Proj{ name = v2.GetString("table") } if v2["auth"] != nil { - newAuth := Slice{} - for k3, _ := range linkAuth.GetSlice(name) { - v3 := linkAuth.GetSlice(name).GetString(k3) - if strings.Contains(v2.GetString("auth"), v3) { - newAuth = append(newAuth, v3) - } - } - linkAuth[name] = newAuth - } + if linkAuth[name] == nil { + linkAuth[name] = v2["auth"] + + } else { + + newAuth := Slice{} + for k3, _ := range linkAuth.GetSlice(name) { + v3 := linkAuth.GetSlice(name).GetString(k3) + if strings.Contains(v2.GetString("auth"), v3) { + newAuth = append(newAuth, v3) + } + } + linkAuth[name] = newAuth + continue + + } + } } } diff --git a/example/config/config.json b/example/config/config.json index 4f15615..63f1577 100644 --- a/example/config/config.json +++ b/example/config/config.json @@ -23,9 +23,9 @@ ], "db": { "mysql": { - "host": "192.168.6.253", - "name": "dgs-cms", - "password": "dasda8454456", + "host": "192.168.2.20", + "name": "gov_crawler", + "password": "fh22y8b882d", "port": "3306", "prefix": "", "user": "root"