|
|
|
@ -19,27 +19,26 @@ class PublicController extends \Think\Controller
|
|
|
|
|
public function login($mobile = null, $verify = null)
|
|
|
|
|
{
|
|
|
|
|
if (IS_POST) {
|
|
|
|
|
$logininfo = ["mobile"=>$mobile];
|
|
|
|
|
//1.验证手机
|
|
|
|
|
$this->check_moblie($mobile);
|
|
|
|
|
$this->check_moblie($logininfo);
|
|
|
|
|
|
|
|
|
|
/* 检测验证码 TODO: */
|
|
|
|
|
if (!$this->checksafecode($mobile, $verify)) {
|
|
|
|
|
$this->error('验证码错误');
|
|
|
|
|
}
|
|
|
|
|
/* 记录登录SESSION和COOKIES */
|
|
|
|
|
$cp_auth = array(
|
|
|
|
|
'mobile' => $mobile
|
|
|
|
|
);
|
|
|
|
|
$session_name = 'payment_user';
|
|
|
|
|
if (I('auto_login')) {
|
|
|
|
|
$expireTime = 60*60*24*30;//自动登录一个月
|
|
|
|
|
ini_set('session.gc_maxlifetime', $expireTime);
|
|
|
|
|
ini_set('session.cookie_lifetime', $expireTime);
|
|
|
|
|
session($session_name, $cp_auth);
|
|
|
|
|
session($session_name.'_sign', data_auth_sign($cp_auth));
|
|
|
|
|
session($session_name, $logininfo);
|
|
|
|
|
session($session_name.'_sign', data_auth_sign($logininfo));
|
|
|
|
|
session($session_name.'_expire', time());
|
|
|
|
|
} else {
|
|
|
|
|
session($session_name, $cp_auth);
|
|
|
|
|
session($session_name.'_sign', data_auth_sign($cp_auth));
|
|
|
|
|
session($session_name, $logininfo);
|
|
|
|
|
session($session_name.'_sign', data_auth_sign($logininfo));
|
|
|
|
|
}
|
|
|
|
|
$this->success('登录成功!', U('Payment/lists'));
|
|
|
|
|
|
|
|
|
@ -143,14 +142,22 @@ class PublicController extends \Think\Controller
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public function check_moblie($mobile){
|
|
|
|
|
$check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile'")->find();
|
|
|
|
|
public function check_moblie(&$logininfo){
|
|
|
|
|
$mobile = $logininfo['mobile'];
|
|
|
|
|
|
|
|
|
|
$check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile' AND `value`= '{$mobile}'")->find();
|
|
|
|
|
if(empty($check_mobile)){
|
|
|
|
|
$this->error('请先配置登陆验证手机');
|
|
|
|
|
}
|
|
|
|
|
$check_mobile = $check_mobile['value'];
|
|
|
|
|
if($check_mobile !== $mobile){
|
|
|
|
|
$this->error('该账号没有权限登录打款系统');
|
|
|
|
|
//获取普通登陆
|
|
|
|
|
$plogin = M("payment_member","tab_")->where("`mobile`= '{$mobile}'")->find();
|
|
|
|
|
if(empty($plogin)){
|
|
|
|
|
$this->error('无此登陆账号');
|
|
|
|
|
}else{
|
|
|
|
|
$logininfo["real_name"] = $plogin['real_name'];
|
|
|
|
|
$logininfo["is_payment"] = 0;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
$logininfo['real_name'] = M("Kv")->field("IFNULL(value,'admin')")->where("`key`='payment_check_name'")->find();
|
|
|
|
|
$logininfo['is_payment'] = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|