- don't mark sync status when directly deleted in CopyStoreSkus

This commit is contained in:
gazebo
2018-10-31 19:23:18 +08:00
parent fdd50744f0
commit c0d5fc60b0
4 changed files with 24 additions and 6 deletions

View File

@@ -15,19 +15,24 @@ const (
)
func SendVerifyCode(mobileNumber string) error {
smsClient := aliyunsmsclient.New("http://dysmsapi.aliyuncs.com/")
code := fmt.Sprintf("%06d", rand.Intn(1000000))
globals.SugarLogger.Debugf("SendVerifyCode mobileNumber:%s, code:%s", mobileNumber, code)
smsClient := aliyunsmsclient.New("http://dysmsapi.aliyuncs.com/")
_, err := smsClient.Execute(globals.AliKey, globals.AliSecret, mobileNumber, "京西菜市", "SMS_84655036", string(utils.MustMarshal(map[string]interface{}{
"code": code,
})))
if err == nil {
globals.Cacher.Set(mobileNumber, code, DefVerifyCodeDuration)
} else {
globals.SugarLogger.Infof("SendVerifyCode mobileNumber:%s failed with error:%v", mobileNumber, err)
}
// globals.SugarLogger.Debug(utils.Format4Output(result, false))
return err
}
func VerifyCode(mobileNumber, code string) bool {
globals.SugarLogger.Debugf("VerifyCode mobileNumber:%s, code:%s", mobileNumber, code)
if value := globals.Cacher.Get(mobileNumber); value != nil {
if code == value.(string) {
globals.Cacher.Del(mobileNumber)