切换阿里短信服务账号

This commit is contained in:
gazebo
2019-10-21 15:48:23 +08:00
parent bed2d85833
commit fceab5848e
6 changed files with 12 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ func init() {
func (a *Auther) SendVerifyCode(mobileNumber string) error {
code := a.GenerateVerifyCode(mobileNumber)
smsClient := aliyunsmsclient.New("http://dysmsapi.aliyuncs.com/")
response, err := smsClient.Execute(globals.AliKey, globals.AliSecret, mobileNumber, "京西菜市", "SMS_84655036", string(utils.MustMarshal(map[string]interface{}{
response, err := smsClient.Execute(globals.AliKey, globals.AliSecret, mobileNumber, "京西菜市", "SMS_175583158", string(utils.MustMarshal(map[string]interface{}{
"code": code,
})))
a.SaveVerifyCode(mobileNumber, code)

View File

@@ -40,7 +40,7 @@ package mobile
// globals.SugarLogger.Debugf("SendVerifyCode mobileNumber:%s, code:%s", mobileNumber, code)
// smsClient := aliyunsmsclient.New("http://dysmsapi.aliyuncs.com/")
// response, err := smsClient.Execute(globals.AliKey, globals.AliSecret, mobileNumber, "京西菜市", "SMS_84655036", string(utils.MustMarshal(map[string]interface{}{
// response, err := smsClient.Execute(globals.AliKey, globals.AliSecret, mobileNumber, "京西菜市", "SMS_175583158", string(utils.MustMarshal(map[string]interface{}{
// "code": code,
// })))
// api.Cacher.Set(mobileNumber, code, DefVerifyCodeDuration)

View File

@@ -30,7 +30,7 @@ func SendSMSMsg(mobileList []string, signName, templateCode string, templatePara
for _, mobileNum := range mobileList {
if mobileNum != "" {
globals.SugarLogger.Debugf("SendSMSMsg mobileNum:%s, templateCode:%s", mobileNum, templateCode)
if globals.EnableStoreWrite {
if true { //globals.EnableStoreWrite {
if response, err := api.SMSClient.Execute(globals.AliKey, globals.AliSecret, mobileNum, signName, templateCode, string(utils.MustMarshal(templateParam))); err != nil {
globals.SugarLogger.Warnf("SendSMSMsg mobileNum:%s failed with error:%v", mobileNum, err)
errList.AddErr(err)
@@ -67,7 +67,7 @@ func getOrderNotifyPhone(order *model.GoodsOrder) (phoneList []string) {
}
func NotifyNewOrder(order *model.GoodsOrder) (err error) {
err = SendSMSMsg(getOrderNotifyPhone(order), "京西菜市", "SMS_173477895", map[string]interface{}{
err = SendSMSMsg(getOrderNotifyPhone(order), "京西菜市", "SMS_175583150", map[string]interface{}{
"daySeq": order.OrderSeq,
"consigneeName": order.ConsigneeName,
"payMoney": jxutils.IntPrice2StandardString(order.ActualPayPrice),
@@ -76,7 +76,7 @@ func NotifyNewOrder(order *model.GoodsOrder) (err error) {
}
func NotifyOrderCanceled(order *model.GoodsOrder) (err error) {
err = SendSMSMsg(getOrderNotifyPhone(order), "京西菜市", "SMS_174275301", map[string]interface{}{
err = SendSMSMsg(getOrderNotifyPhone(order), "京西菜市", "SMS_175573134", map[string]interface{}{
"vendorName": model.VendorChineseNames[order.VendorID],
"seq": order.OrderSeq,
"orderID": order.VendorOrderID,

View File

@@ -14,7 +14,7 @@ func init() {
}
func TestSendSMSMsg(t *testing.T) {
err := SendSMSMsg([]string{"18180948107"}, "京西菜市", "SMS_173477895", map[string]interface{}{
err := SendSMSMsg([]string{"18180948107"}, "京西菜市", "SMS_175583150", map[string]interface{}{
"daySeq": 9,
"consigneeName": "购买者",
"payMoney": jxutils.IntPrice2StandardString(1230),

View File

@@ -1,7 +1,7 @@
package elm
import (
"github.com/KenmyZhang/aliyun-communicate"
aliyunsmsclient "github.com/KenmyZhang/aliyun-communicate"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
@@ -10,9 +10,9 @@ import (
)
const (
ELM_SMS_SIGN_NAME = "好菜鲜生" //饿了么短信推送的签名
ELM_SMS_REMINDERS_DAIPEISHONG_TEMPLATECODE = "SMS_135028810" //饿了么待配送模板ID
ELM_SMS_REMINDERS_PEISHOGNZHONG_TEMPLATECODE = "SMS_139225187" //饿了么配送中模板ID
ELM_SMS_SIGN_NAME = "京西菜市" //饿了么短信推送的签名
ELM_SMS_REMINDERS_DAIPEISHONG_TEMPLATECODE = "SMS_175573181" //饿了么待配送模板ID
ELM_SMS_REMINDERS_PEISHOGNZHONG_TEMPLATECODE = "SMS_175583155" //饿了么配送中模板ID
)
func (c *PurchaseHandler) ClientUrgeOrder(orderID string) (err error) {

View File

@@ -31,8 +31,8 @@ enableElmStoreWrite = false
enableMtwmStoreWrite = false
enableWscStoreWrite = false
aliKey = "LTAI6xJUGaP6WdMQ"
aliSecret = "CLmx5T93Bgi89EGAxWM4RTAXUsiHbM"
aliKey = "LTAI4FwZN7pp4dACQHoapkZQ"
aliSecret = "NTegceUFX0FdfMovqCDzqcIKmhcoOu"
qiniuAK = "bKWilgyrJlc8aXgLEpCUmRrYcxJ8OYhoKk5mO3jJ"
qiniuSK = "3MNdU_lKnu22vrNtUELDcLBv23UOUWYKzc16Pmkj"