...
|
...
|
@@ -24,15 +24,20 @@ class LoginData |
|
|
* @param string $area 地区编号
|
|
|
* @param string $profile 邮箱或手机号
|
|
|
* @param string $password 密码
|
|
|
* @param string $shoppingKey 未登录用户唯一识别码, 默认为空
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function signin($area, $profile, $password)
|
|
|
public static function signin($area, $profile, $password, $shoppingKey = null)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.passport.signin';
|
|
|
$param['area'] = $area;
|
|
|
$param['profile'] = $profile;
|
|
|
$param['password'] = $password;
|
|
|
if (!empty($shoppingKey)) {
|
|
|
$param['shopping_key'] = $shoppingKey;
|
|
|
}
|
|
|
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::post(Yohobuy::API_URL, $param);
|
...
|
...
|
@@ -59,9 +64,10 @@ class LoginData |
|
|
* @param string $nickname 姓名
|
|
|
* @param string $openId 第三方唯一识别码
|
|
|
* @param string $sourceType 登录方式
|
|
|
* @param string $shoppingKey 未登录用户唯一识别码, 默认为空
|
|
|
* @return array 登录返回结果
|
|
|
*/
|
|
|
public static function signinByOpenID($nickname, $openId, $sourceType)
|
|
|
public static function signinByOpenID($nickname, $openId, $sourceType, $shoppingKey = null)
|
|
|
{
|
|
|
// 构建必传参数
|
|
|
$param = Yohobuy::param();
|
...
|
...
|
@@ -71,6 +77,9 @@ class LoginData |
|
|
$param['source_type'] = $sourceType;
|
|
|
$param['nickname'] = $nickname;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
if (!empty($shoppingKey)) {
|
|
|
$param['shopping_key'] = $shoppingKey;
|
|
|
}
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
...
|
...
|
|