Commit dbe69020 authored by luhongguang's avatar luhongguang

update: 处理冲突

parents 1cc9d547 824b111a
...@@ -272,7 +272,9 @@ class GoodsService ...@@ -272,7 +272,9 @@ class GoodsService
$skuParams['online_status'] = 0; $skuParams['online_status'] = 0;
break; break;
default: default:
# code... $skuParams['online_type'] = 1;
$skuParams['online_status'] = 0;
$skuParams['online_start_time'] = date("Y-m-d H:i:s");
break; break;
} }
......
...@@ -26,7 +26,6 @@ class UserService ...@@ -26,7 +26,6 @@ class UserService
public static function wechatLogin($params) public static function wechatLogin($params)
{ {
$code = !empty($params['code']) ? $params['code'] : '';//小程序授权code $code = !empty($params['code']) ? $params['code'] : '';//小程序授权code
$openid = !empty($params['openid']) ? $params['openid'] : '';//小程序授权code $openid = !empty($params['openid']) ? $params['openid'] : '';//小程序授权code
if (empty($code) && empty($openid)) { if (empty($code) && empty($openid)) {
...@@ -34,6 +33,21 @@ class UserService ...@@ -34,6 +33,21 @@ class UserService
throw new UserException(['cus' => 0]); throw new UserException(['cus' => 0]);
} }
$redis = RedisUtil::getInstance('cache');
$key = "wx_wechat_login_".$code;
$keyCode = "wx_wechat_login_code_".$code;
$lock = FrequencyLockUtil::isLocked($key,1,120);
if ($lock) {
sleep(1);
$user = $redis->get($keyCode);
if (!empty($user)) {
$user = json_decode($user,true);
}
FileLog::error("wechatLogin: lock", json_encode($user, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
FileLog::error("wechatLogin: lock--params", json_encode($params, JSON_UNESCAPED_UNICODE),'','jianghaiming@yidian-inc.com');
return $user;
}
//需要授权微信 //需要授权微信
//if (empty($openid)) { //if (empty($openid)) {
$appid = \Yaf\Registry::get('config')->wechat->appid; $appid = \Yaf\Registry::get('config')->wechat->appid;
...@@ -107,8 +121,9 @@ class UserService ...@@ -107,8 +121,9 @@ class UserService
]; ];
$newWechatId = UserWechatBind::save($insert, ['openid' => $openid]); $newWechatId = UserWechatBind::save($insert, ['openid' => $openid]);
} }
$user['third_session'] = self::generate3rdSession($openid); $user['third_session'] = self::generate3rdSession($openid);
$redis->set($keyCode, json_encode($user),120);
return $user; return $user;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment