BackData.php
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace LibModels\Web\Passport;
use Api\Sign;
use Api\Yohobuy;
class BackData extends \LibModels\Wap\Passport\BackData
{
/**
* 验证找回邮件code
*
* @param string $code
* @return array
*/
public static function checkEmailCode($code)
{
$param = Yohobuy::param();
$param['method'] = 'app.register.checkCodeValid';
$param['code'] = $code;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, true); // 缓存1小时
}
/**
* 根据邮箱code修改密码
*
* @param string $code
* @param string $password
* @return array
*/
public static function modifyPasswordByEmailCode($code, $password)
{
$param = Yohobuy::param();
$param['method'] = 'app.register.resetPwdByCode';
$param['code'] = $code;
$param['newPwd'] = $password;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
}