- move Cacher from globals to api
- vendorPromotionID for CreatePromotion - LockPromotionSkus
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/KenmyZhang/aliyun-communicate"
|
||||
)
|
||||
|
||||
@@ -23,7 +24,7 @@ func SendVerifyCode(mobileNumber string) error {
|
||||
"code": code,
|
||||
})))
|
||||
if err == nil {
|
||||
globals.Cacher.Set(mobileNumber, code, DefVerifyCodeDuration)
|
||||
api.Cacher.Set(mobileNumber, code, DefVerifyCodeDuration)
|
||||
} else {
|
||||
globals.SugarLogger.Infof("SendVerifyCode mobileNumber:%s failed with error:%v", mobileNumber, err)
|
||||
}
|
||||
@@ -33,9 +34,9 @@ func SendVerifyCode(mobileNumber string) error {
|
||||
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 value := api.Cacher.Get(mobileNumber); value != nil {
|
||||
if code == value.(string) {
|
||||
globals.Cacher.Del(mobileNumber)
|
||||
api.Cacher.Del(mobileNumber)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user