|
123456789101112131415161718192021 |
- package sms
-
- import (
- "applet/app/lib/zhimeng"
- "applet/app/svc"
- "applet/app/utils/logx"
-
- "github.com/gin-gonic/gin"
- )
-
- // NewZhimengSMS is 智盟的短信服务
- func NewZhimengSMS(c *gin.Context) *zhimeng.SDK {
- sms := new(zhimeng.SDK)
- key := svc.SysCfgGet(c, "third_zm_sms_key")
- secret := svc.SysCfgGet(c, "third_zm_sms_secret")
- if key == "" || secret == "" {
- _ = logx.Warn("短信服务配置错误")
- }
- sms.Init("send_msg", key, secret)
- return sms
- }
|