From e820abf686e28350dbe3d3effd99889594624add Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 5 Aug 2019 14:55:34 +0800 Subject: [PATCH] =?UTF-8?q?-=20checkConfig=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/cms.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index b81c5ae47..9a4a8799e 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -201,7 +201,7 @@ func SendMsg2Somebody(ctx *jxcontext.Context, mobileNum, verifyCode, msgType, ms return err } -func checkConfig(configType, value string) (err error) { +func checkConfig(configType, key, value string) (err error) { switch configType { case model.ConfigTypePricePack: if value != "" { @@ -212,8 +212,8 @@ func checkConfig(configType, value string) (err error) { } case model.ConfigTypeBank: if value != "" { - if model.BankName[value] == "" { - err = fmt.Errorf("些银行代码:%s不支持,请联系开发", value) + if model.BankName[key] == "" { + err = fmt.Errorf("此银行代码:%s不支持,请联系开发", value) } } default: @@ -223,7 +223,7 @@ func checkConfig(configType, value string) (err error) { } func AddConfig(ctx *jxcontext.Context, key, configType, value string) (err error) { - if err = checkConfig(configType, value); err != nil { + if err = checkConfig(configType, key, value); err != nil { return err } @@ -238,7 +238,7 @@ func AddConfig(ctx *jxcontext.Context, key, configType, value string) (err error } func DeleteConfig(ctx *jxcontext.Context, key, configType string) (err error) { - if err = checkConfig(configType, ""); err != nil { + if err = checkConfig(configType, key, ""); err != nil { return err } switch configType { @@ -267,7 +267,7 @@ func UpdateConfig(ctx *jxcontext.Context, key, configType, value string) (err er if key == "" { return fmt.Errorf("修改配置必须给定key") } - if err = checkConfig(configType, value); err != nil { + if err = checkConfig(configType, key, value); err != nil { return err }