Commit 33c304d1 authored by zhuwei's avatar zhuwei

1

parent 7dea144d
...@@ -50,10 +50,12 @@ class BrokerService ...@@ -50,10 +50,12 @@ class BrokerService
"is_pc" => $is_pc ]); "is_pc" => $is_pc ]);
return true; return true;
} }
$is_exits = false; $is_exits = false;
foreach ($result as $item) { foreach ($result as $item) {
//如果是客户端登录 //如果是客户端登录
if($is_pc == 2){ if($is_pc == 2){
if ($device_id == $item["device_id"]) if ($device_id == $item["device_id"])
{ {
if ($item["is_forbidden"] == 0) { if ($item["is_forbidden"] == 0) {
......
...@@ -185,5 +185,6 @@ function del_array_string($string = '', $array_str = []) { ...@@ -185,5 +185,6 @@ function del_array_string($string = '', $array_str = []) {
*/ */
function big_log($content){ function big_log($content){
$filename = ROOT_PATH.'runtime/log/find_bug.log'; $filename = ROOT_PATH.'runtime/log/find_bug.log';
$content = '['.date("Y-m-d H:i:s", time()).'] '.$content;
file_put_contents($filename, $content."\r\n", FILE_APPEND); file_put_contents($filename, $content."\r\n", FILE_APPEND);
} }
\ No newline at end of file
...@@ -57,7 +57,6 @@ class Login extends Basic ...@@ -57,7 +57,6 @@ class Login extends Basic
$model = $this->params["model"]; $model = $this->params["model"];
$only_id = $this->params["only_id"]; $only_id = $this->params["only_id"];
$mac_address = $this->params["mac_address"]; $mac_address = $this->params["mac_address"];
if (empty($name) || empty($password)) { if (empty($name) || empty($password)) {
return $this->response(101, '用户名或密码不能为空'); return $this->response(101, '用户名或密码不能为空');
} }
...@@ -97,9 +96,11 @@ class Login extends Basic ...@@ -97,9 +96,11 @@ class Login extends Basic
//判断设备id是否存在 //判断设备id是否存在
if($mac_address){ if($mac_address){
$is_pc = 2;//客户端 $is_pc = 2;//客户端
$last_login_ip = $mac_address;//device_id存MAC地址
}else{ }else{
$is_pc = 1;//浏览器 $is_pc = 1;//浏览器
} }
$is_login = $this->brokerService->judgeBand($last_login_ip, $user_data['id'], $model, 0,$only_id , $is_pc); $is_login = $this->brokerService->judgeBand($last_login_ip, $user_data['id'], $model, 0,$only_id , $is_pc);
if (!$is_login) { if (!$is_login) {
return $this->response("102", "该账号没有绑定该设备的浏览器,请先向店长申请,由店长致电财务董飞。"); return $this->response("102", "该账号没有绑定该设备的浏览器,请先向店长申请,由店长致电财务董飞。");
......
...@@ -92,7 +92,6 @@ class ABindingDevice extends BaseModel ...@@ -92,7 +92,6 @@ class ABindingDevice extends BaseModel
} catch (\Exception $e) { } catch (\Exception $e) {
$data = []; $data = [];
} }
return $data; return $data;
} }
......
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