|
@@ -16,9 +16,6 @@ class LoginType extends SplEnum
|
|
|
|
|
|
class member_loginControl extends mbMemberControl
|
|
|
{
|
|
|
- const auth_code_expire = 5; // 单位:分钟
|
|
|
- const token_expire = 3; // 单位:分钟
|
|
|
-
|
|
|
public function __construct()
|
|
|
{
|
|
|
parent::__construct();
|
|
@@ -44,7 +41,7 @@ class member_loginControl extends mbMemberControl
|
|
|
$status = $sms->send($mobile, array('code' => $code, 'type' => Sms::register_code, 'time' => '5'));
|
|
|
if ($status == 0) {
|
|
|
$key = func::gen_auth_code_key($mobile);
|
|
|
- wcache($key, array('code' => $code, 'mobile' => $mobile), '', self::auth_code_expire);
|
|
|
+ wcache($key, array('code' => $code, 'mobile' => $mobile), '', func::auth_code_expire);
|
|
|
} else {
|
|
|
return joutput_error(errcode::ErrSms, "send error={$status}.");
|
|
|
}
|
|
@@ -136,7 +133,7 @@ class member_loginControl extends mbMemberControl
|
|
|
} else {
|
|
|
$ret_val = array();
|
|
|
$ret_val['token'] = $token;
|
|
|
- $ret_val['cache_expiration_time'] = time() + self::token_expire * 60;
|
|
|
+ $ret_val['cache_expiration_time'] = time() + func::token_expire * 60;
|
|
|
$ret_val['systime'] = time();
|
|
|
return joutput_data($ret_val);
|
|
|
}
|
|
@@ -157,7 +154,7 @@ class member_loginControl extends mbMemberControl
|
|
|
} else {
|
|
|
$ret_val = array();
|
|
|
$ret_val['token'] = $token;
|
|
|
- $ret_val['cache_expiration_time'] = time() + self::token_expire * 60;
|
|
|
+ $ret_val['cache_expiration_time'] = time() + func::token_expire * 60;
|
|
|
$ret_val['systime'] = time();
|
|
|
return joutput_data($ret_val);
|
|
|
}
|