Browse Source

短信api

master
huangjiajun 1 year ago
parent
commit
e7029e551c
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      sms/api.go

+ 3
- 3
sms/api.go View File

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


Loading…
Cancel
Save