- 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

@@ -44,6 +44,8 @@ func init() {
}
func GetUserInfo(code string, state string) (token *UserInfoExt, err error) {
globals.SugarLogger.Debugf("GetUserInfo code:%s", code)
if state == "" {
wxapi := weixinsnsapi.New(api.WeixinAPI.GetAppID(), api.WeixinAPI.GetSecret())
token, err2 := wxapi.RefreshToken(code)
@@ -51,6 +53,7 @@ func GetUserInfo(code string, state string) (token *UserInfoExt, err error) {
wxUserinfo, err2 := wxapi.GetUserInfo(token.OpenID)
if err = err2; err == nil {
pwd := utils.GetUUID()
globals.SugarLogger.Debugf("GetUserInfo code:%s, pwd:%s", code, pwd)
globals.Cacher.Set(wxUserinfo.OpenID, pwd, DefTempPasswordDuration)
return &UserInfoExt{
UserInfo: *wxUserinfo,
@@ -65,6 +68,8 @@ func GetUserInfo(code string, state string) (token *UserInfoExt, err error) {
}
func (a *Auther) Login(openid, password string) (err error) {
globals.SugarLogger.Debugf("Login openid:%s, password:%s", openid, password)
if value := globals.Cacher.Get(openid); value != nil {
if password == value.(string) {
// wxUser := &legacymodel.WeiXins{
@@ -86,6 +91,8 @@ func (a *Auther) Logout(openid string) error {
}
func BindMobile(token, mobileNum, code, nickname string) (err error) {
globals.SugarLogger.Debugf("BindMobile mobileNum:%s, code:%s, nickname:%s", mobileNum, code, nickname)
loginInfo := new(auth.LoginInfo)
if err = globals.Cacher.GetAs(token, loginInfo); err == nil {
if mobile.VerifyCode(mobileNum, code) {