package sms import ( "strings" "videoweb/pub/common/sms/fengniao" ) type Provider = int const ( tmplID1 = "6029f19a99fd8b404062e4d2" // 大陆 tmplID2 = "5f8412c39396d16f787e561b" // 非大陆 ) const ( FengNiao Provider = 1 //蜂鸟 YunPian Provider = 2 //云片 ) func sendByFengNiao(mobile string, code string) error { var tmplID string if strings.HasPrefix(mobile, "+86") { tmplID = tmplID1 return (&fengniao.FengNiao{ Url: "https://t9x6k.cc/api/sms/sendSms", MercId: "10177", Secret: "2dfb7ec44ed59ee3c1fe8dc533384e16", Tmpl: tmplID, }).Send(mobile, code) } else { tmplID = tmplID2 return (&fengniao.FengNiao{ Url: "https://t9x6k.cc/api/sms/sendSms", MercId: "10228", Secret: "3ea58a27a162dad4ed3e18c076648742", Tmpl: tmplID, }).Send(mobile, code) } // return } // Send 发送短信 func Send(mobile string, code string) error { return sendByFengNiao(mobile, code) }