only("account","password"); //登录 $result = (new EmployeeService())->loginRule($data); list($bool, $return) = $result; if(! $bool) return $this->json_return(201,'',$return); $password = Hash::make($data['password']); //生成token $jwtToken = TokenService::getToken($return['id'], $password); return $this->json_return(200,'', ['id' => $return['id'],'token' => $jwtToken, 'emp_name'=>$return['name']]); } }