Authored by hf

do modify login call old session

... ... @@ -186,7 +186,7 @@ class Yohobuy
* @param array $cookie
* @return mixed
*/
public static function post($url, $data = array(), $returnJson = false, $timeout = 30, $header = array(), $cookie = array())
public static function post($url, $data = array(), $returnJson = false, $timeout = 10, $header = array(), $cookie = array())
{
$ch = curl_init($url);
... ... @@ -214,7 +214,7 @@ class Yohobuy
if (!empty($data)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
$result = curl_exec($ch);
$result = curl_exec($ch);
if (!$returnJson && !empty($result)) {
$result = json_decode($result, true);
}
... ...
... ... @@ -36,7 +36,7 @@ class DetailData
$param['productId'] = $productId;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
var_dump($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ...
... ... @@ -31,7 +31,7 @@ class DetailModel
if (is_numeric($productId) && is_numeric($goodsId)) {
// 调用服务
$baseInfo = DetailData::baseInfo($productId, $uid);
$baseInfo = DetailData::baseInfo($productId, $uid); var_dump($baseInfo);
// 判断商品是否在架
if (empty($baseInfo['status'])) {
... ... @@ -83,6 +83,7 @@ class DetailModel
foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
$build['level'] = $value['vipLevel'];
$build['text'] = $value['vipPrice'];
$build['currentLevel'] = false;
$result['vipLevel']['list'][] = $build;
}
}
... ...
... ... @@ -110,19 +110,16 @@ class LoginController extends AbstractAction
break;
}
// /* 获取用户的信息 */
// $profile = LoginData::profile($data['data']['uid']);
// $name = 'YOHO!';
// if (!empty($profile['data']['nickname'])) {
// $name = $profile['data']['nickname'];
// } elseif (!empty($profile['data']['username'])) {
// $name = $profile['data']['username'];
// } elseif (!empty($profile['data']['email'])) {
// $name = $profile['data']['email'];
// } elseif (!empty($profile['data']['mobile'])) {
// $name = $profile['data']['mobile'];
// }
$data['data'] = '/'; // @todo
$refer = $this->getCookie('refer');
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
}
$data['data'] = array(
// 调用老系统的SESSION会话
'session' => 'http://m1.yohobuy.com/Passport/session/index?uid=' . $data['data']['uid'] . '&sign=' . md5($data['data']['uid'] . 'Js8Yn0!EwPM45-ws'),
'href' => rawurldecode($refer),
);
} while (false);
$this->echoJson($data);
... ...
... ... @@ -125,7 +125,7 @@ class RegController extends AbstractAction
}
/* 向手机发送注册验证码 */
$data = RegData::sendCodeToMobile($area, $mobile); var_dump($data);
$data = RegData::sendCodeToMobile($area, $mobile);
if (!isset($data['code'])) {
break;
}
... ... @@ -262,6 +262,7 @@ class RegController extends AbstractAction
/* 验证注册的标识码是否有效 */
$data = RegData::regMobile($area, $mobile, $password);
var_dump($data);
if (!isset($data['code'])) {
break;
}
... ...