diff --git a/sms/api.go b/sms/api.go index fb2292a..cbb21d5 100644 --- a/sms/api.go +++ b/sms/api.go @@ -60,7 +60,7 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error { "ext", //自定义信息,状态报告时返回,可以为空 } for _, v := range param { - if args[v] != "" { + if args[v] != "" && args[v] != nil { where[v] = args[v].(string) } } @@ -93,8 +93,8 @@ func SmsSend(engine *xorm.Engine, args map[string]interface{}) error { if err != nil { return err } - success := gjson.Get(send, "success").Int() - if success == 0 { + success := gjson.Get(send, "code").Int() + if success != 20000 { return errors.New("发送失败") } }