提交 07ddae0a authored 作者: chengye's avatar chengye

调整登录返回信息格式为Json

上级 3a638313
......@@ -32,7 +32,7 @@ class Login extends Controller
'status' => 0,
'message' => $validate->getError()
];
return $data;
return json($data);
}
$captcha = new Captcha();
if( !$captcha->check($request->post('verify')))
......@@ -41,7 +41,7 @@ class Login extends Controller
'status' => 0,
'message' => '验证码错误'
];
return $data;
return json($data);
}
//如果是邮箱
if(preg_match($pattern,$request->post('name'))){
......@@ -81,7 +81,7 @@ class Login extends Controller
'status' => 0,
'message' => '用户不存在'
];
return $data;
return json($data);
}
$status=(new StaffModel)->getStaffStatusByName($email);
if(!$status['status']==1){
......@@ -89,7 +89,7 @@ class Login extends Controller
'status' => 0,
'message' => '该账户当前禁用,请联系管理员开启'
];
return $data;
return json($data);
}
if(decrypt($passwd) == $staff->passwd->passwd){
$user = [
......@@ -106,7 +106,7 @@ class Login extends Controller
'status' => 0,
'message' => '用户名或密码错误'
];
return $data;
return json($data);
}
}
......@@ -121,7 +121,7 @@ class Login extends Controller
'status' => 0,
'message' => '用户名或密码错误'
];
return $data;
return json($data);
} else {
loginlog($admin->name,$admin->id,'管理员用户成功登录系统',1);
$user = [
......@@ -156,7 +156,7 @@ class Login extends Controller
//存储到redis
Cache::store('redis')->set($encryptKey,json_encode($user),3600);
return $data;
return json($data);
}
private function getRandomStr($length = 10){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论