Commit 67f392bb authored by zfc's avatar zfc

登录合并2

parent 17ad3691
......@@ -46,25 +46,25 @@ class Login extends Basic
if (!isset($name) || !isset($passwd)) {
return view("/login/login", [ "msg" => "用户名或密码不能为空" ]);
}
if($name=='admin'){
$params["name"] = $name;
$params["pswd"] = md5(md5($passwd));
$result = $this->loginDb->verifyUser($params);
if (count($result) > 0) {
//todo 更新登录信息
$this->loginDb->updateLoginTime($result[0]["id"]);
Session::set("userName",$result[0]["name"]);
Session::set("userId",$result[0]["id"]);
Session::set("usertable",'admin');
Session::set("lastLoginTime",time());
$this->operating_records($result[0]["id"],1,'后台登陆'); //记录操作日志
$this->redirect('/admin.php/index/banner');
} else {
return view("/login/login", [ "msg" => "用户名或密码错误" ]);
}
}else{
// if($name=='admin'){
// $params["name"] = $name;
// $params["pswd"] = md5(md5($passwd));
// $result = $this->loginDb->verifyUser($params);
//
// if (count($result) > 0) {
// /*todo 更新登录信息*/
// $this->loginDb->updateLoginTime($result[0]["id"]);
//
// Session::set("userName",$result[0]["name"]);
// Session::set("userId",$result[0]["id"]);
// Session::set("usertable",'admin');
// Session::set("lastLoginTime",time());
// $this->operating_records($result[0]["id"],1,'后台登陆'); //记录操作日志
// $this->redirect('/admin.php/index/banner');
// } else {
// return view("/login/login", [ "msg" => "用户名或密码错误" ]);
// }
// }else{
//条件
$filed=" a.id,a.store_id,a.auth_group_id,a.district_id,a.level,a.name,a.phone,a.sex,a.img,a.status,a.admin_off,
ifnull(s.store_name,'')store_name,ifnull(d.district_name,'')district_name,g.rules";
......@@ -75,7 +75,7 @@ class Login extends Basic
];
$params["name"] = $name;
$passwd = md5($passwd);
$where="(name='{$name}'or phone='{$name}') and password='$passwd' ";
$where="( phone='{$name}') and password='$passwd' ";
$list=$this->loginagent->verifyUser($filed,$join,$where);
if(!$list){
return view("/login/login", [ "msg" => "用户名或密码错误" ]);
......@@ -124,7 +124,7 @@ class Login extends Basic
}
// }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment