From dcf7222948ef9d85f0599d97fbfac483f4896099 Mon Sep 17 00:00:00 2001 From: v-me-50 Date: Fri, 20 Jun 2025 16:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=92=E4=BB=B6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/cert/deploy/plugin/deploy.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/backend/internal/cert/deploy/plugin/deploy.go b/backend/internal/cert/deploy/plugin/deploy.go index 3c11dd4..1fd76a4 100644 --- a/backend/internal/cert/deploy/plugin/deploy.go +++ b/backend/internal/cert/deploy/plugin/deploy.go @@ -49,9 +49,19 @@ func Deploy(cfg map[string]any, logger *public.Logger) error { if !ok { return fmt.Errorf("插件名称错误") } - pluginConfig, ok := providerConfig["config"].(map[string]any) - if !ok { - return fmt.Errorf("插件配置错误") + var pluginConfig map[string]any + switch v := providerConfig["config"].(type) { + case map[string]any: + pluginConfig = v + case string: + err = json.Unmarshal([]byte(v), &pluginConfig) + if err != nil { + fmt.Println(v) + return fmt.Errorf("插件配置解析错误:%v", err) + } + default: + fmt.Println(v) + return fmt.Errorf("插件配置格式错误") } pluginParams, ok := cfg["params"].(string) if !ok {