|
@@ -181,19 +181,19 @@ class Passport extends Controller
|
|
|
}else{
|
|
}else{
|
|
|
//注册新用户
|
|
//注册新用户
|
|
|
// 1.调用名厨之家第三方应用注册接口注册用户并返回用户信息
|
|
// 1.调用名厨之家第三方应用注册接口注册用户并返回用户信息
|
|
|
- $postData = [
|
|
|
|
|
- 'mobile' => (string)$mobile,
|
|
|
|
|
- 'openid' => '',
|
|
|
|
|
- 'source' => 12
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+// $postData = [
|
|
|
|
|
+// 'mobile' => (string)$mobile,
|
|
|
|
|
+// 'openid' => '',
|
|
|
|
|
+// 'source' => 12
|
|
|
|
|
+// ];
|
|
|
|
|
|
|
|
|
|
|
|
|
- $cur_url = config('chef.serv_cookhome').'/api/wx/third_platform_register';
|
|
|
|
|
- $res = curl_post($cur_url, $postData);
|
|
|
|
|
|
|
+ //$cur_url = config('chef.serv_cookhome').'/api/wx/third_platform_register';
|
|
|
|
|
+ //$res = curl_post($cur_url, $postData);
|
|
|
|
|
|
|
|
- $res = json_decode($res, true);
|
|
|
|
|
|
|
+ //$res = json_decode($res, true);
|
|
|
// 获取名厨用户id
|
|
// 获取名厨用户id
|
|
|
- $chef_user_id = $res['id'];
|
|
|
|
|
|
|
+ //$chef_user_id = $res['id'];
|
|
|
|
|
|
|
|
// 2.本地数据库写入用户信息
|
|
// 2.本地数据库写入用户信息
|
|
|
$params = $this->request->post();
|
|
$params = $this->request->post();
|
|
@@ -202,7 +202,7 @@ class Passport extends Controller
|
|
|
$params['isParty'] = false;
|
|
$params['isParty'] = false;
|
|
|
$params['openid'] = '';
|
|
$params['openid'] = '';
|
|
|
$params['unionid'] = $info['unionid'] ?? '';
|
|
$params['unionid'] = $info['unionid'] ?? '';
|
|
|
- $params = array_merge($params,['userId' => $chef_user_id, 'mobile' => $mobile]);
|
|
|
|
|
|
|
+ $params = array_merge($params,['userId' => 0, 'mobile' => $mobile]);
|
|
|
if (!$LoginService->login($params)) {
|
|
if (!$LoginService->login($params)) {
|
|
|
return $this->renderError($LoginService->getError());
|
|
return $this->renderError($LoginService->getError());
|
|
|
}
|
|
}
|
|
@@ -277,22 +277,22 @@ class Passport extends Controller
|
|
|
}else{
|
|
}else{
|
|
|
//注册新用户
|
|
//注册新用户
|
|
|
// 1.调用名厨之家第三方应用注册接口注册用户并返回用户信息
|
|
// 1.调用名厨之家第三方应用注册接口注册用户并返回用户信息
|
|
|
- $postData = [
|
|
|
|
|
- 'mobile' => $mobile,
|
|
|
|
|
- 'openid' => $openid,
|
|
|
|
|
- 'source' => 12
|
|
|
|
|
- ];
|
|
|
|
|
- $res = curl_post(config('chef.serv_cookhome').'/api/wx/third_platform_register', $postData);
|
|
|
|
|
- $res = json_decode($res, true);
|
|
|
|
|
- // 获取名厨用户id
|
|
|
|
|
- $chef_user_id = $res['id'];
|
|
|
|
|
|
|
+// $postData = [
|
|
|
|
|
+// 'mobile' => $mobile,
|
|
|
|
|
+// 'openid' => $openid,
|
|
|
|
|
+// 'source' => 12
|
|
|
|
|
+// ];
|
|
|
|
|
+// $res = curl_post(config('chef.serv_cookhome').'/api/wx/third_platform_register', $postData);
|
|
|
|
|
+// $res = json_decode($res, true);
|
|
|
|
|
+// // 获取名厨用户id
|
|
|
|
|
+// $chef_user_id = $res['id'];
|
|
|
|
|
|
|
|
// 2.本地数据库写入用户信息
|
|
// 2.本地数据库写入用户信息
|
|
|
$params = $this->request->post();
|
|
$params = $this->request->post();
|
|
|
$params['oauth'] = 'MP-WEIXIN';
|
|
$params['oauth'] = 'MP-WEIXIN';
|
|
|
$params['isParty'] = true;
|
|
$params['isParty'] = true;
|
|
|
$params['unionid'] = $info['unionid'] ?? '';
|
|
$params['unionid'] = $info['unionid'] ?? '';
|
|
|
- $params = array_merge($params,['userId' => $chef_user_id, 'mobile' => $mobile]);
|
|
|
|
|
|
|
+ $params = array_merge($params,['userId' => 0, 'mobile' => $mobile]);
|
|
|
if (!$LoginService->login($params)) {
|
|
if (!$LoginService->login($params)) {
|
|
|
return $this->renderError($LoginService->getError());
|
|
return $this->renderError($LoginService->getError());
|
|
|
}
|
|
}
|