|
|
@@ -35,7 +35,7 @@ class Login extends Api
|
|
|
// 接收数据
|
|
|
$password = $Request->input('password', '');
|
|
|
// 查询用户
|
|
|
- $admin = $EmployeeModel->Where('employee_code', $employee_code)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
+ $admin = $EmployeeModel->Where('employee_code', $employee_code)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
// 用户不存在
|
|
|
if (!$admin || $admin['status']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
|
|
|
// 用户不存在
|
|
|
@@ -45,7 +45,7 @@ class Login extends Api
|
|
|
// 比对密码
|
|
|
if (md5($password) != $admin['password']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
|
|
|
// 登录
|
|
|
- $accessToken = $EmployeeModel->Login($admin['id'], 'api');
|
|
|
+ $accessToken = $EmployeeModel->Login($admin['id'],$admin['company_id'], 'api');
|
|
|
// 比对密码
|
|
|
if (isset($accessToken['error'])) return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
|
|
|
// 获取权限列表
|
|
|
@@ -94,7 +94,7 @@ class Login extends Api
|
|
|
// 接收数据
|
|
|
$password = $Request->input('password', '');
|
|
|
// 查询用户
|
|
|
- $user_info = $EmployeeModel->where('mobile', $phone)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
+ $user_info = $EmployeeModel->where('mobile', $phone)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
// 用户不存在
|
|
|
if (!$user_info || $user_info['status']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
|
|
|
// 用户不存在
|
|
|
@@ -104,7 +104,7 @@ class Login extends Api
|
|
|
// 比对密码
|
|
|
if (md5($password) != $user_info['password']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
|
|
|
// 登录
|
|
|
- $accessToken = $EmployeeModel->Login($user_info['id'], 'api');
|
|
|
+ $accessToken = $EmployeeModel->Login($user_info['id'],$user_info['company_id'], 'api');
|
|
|
// 比对密码
|
|
|
if (isset($accessToken['error'])) return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
|
|
|
// 获取权限列表
|
|
|
@@ -163,7 +163,7 @@ class Login extends Api
|
|
|
// 接收数据
|
|
|
$password = $Request->input('password', '');
|
|
|
// 查询用户
|
|
|
- $admin = $EmployeeModel->where('email', $email)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
+ $admin = $EmployeeModel->where('email', $email)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
// 用户不存在
|
|
|
if (!$admin) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
|
|
|
// 用户不存在
|
|
|
@@ -173,7 +173,7 @@ class Login extends Api
|
|
|
// 比对密码
|
|
|
if (md5($password) != $admin['password']) return json_send(['code' => 'error', 'msg' => '密码错误或账号不存在']);
|
|
|
// 登录
|
|
|
- $accessToken = $EmployeeModel->Login($admin['id'], 'api');
|
|
|
+ $accessToken = $EmployeeModel->Login($admin['id'],$admin['company_id'], 'api');
|
|
|
// 比对密码
|
|
|
if (isset($accessToken['error'])) return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
|
|
|
// 获取权限列表
|
|
|
@@ -205,7 +205,7 @@ class Login extends Api
|
|
|
if (!$session) return json_send(['code' => 'error', 'msg' => '请先获取手机号验证码']);
|
|
|
if ($session['code'] != $code || $session['mobile'] != $phone) return json_send(['code' => 'error', 'msg' => '验证码错误']);
|
|
|
// 查询用户
|
|
|
- $admin = $EmployeeModel->where('mobile', $phone)->first(['id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
+ $admin = $EmployeeModel->where('mobile', $phone)->first(['company_id','id', 'name', 'mobile', 'status', 'password', 'insert_time', 'update_time']);
|
|
|
// 用户不存在
|
|
|
if (!$admin) return json_send(['code' => 'error', 'msg' => '账号不存在']);
|
|
|
// 用户不存在
|
|
|
@@ -213,7 +213,7 @@ class Login extends Api
|
|
|
// 转数组
|
|
|
$admin = $admin->toArray();
|
|
|
// 登录
|
|
|
- $accessToken = $EmployeeModel->Login($admin['id'], 'api');
|
|
|
+ $accessToken = $EmployeeModel->Login($admin['id'],$admin['company_id'], 'api');
|
|
|
// 比对密码
|
|
|
if (isset($accessToken['error'])) return json_send(['code' => 'error', 'msg' => '登录失败', 'data' => $accessToken['data']]);
|
|
|
// 获取权限列表
|