Merge branch 'dev' of wmtx/sdk into master

下线行为日志 不记录
登入行为日志不记录
master
张谷诚 5 years ago committed by Gogs
commit c369403699

@ -29,17 +29,17 @@ class UserController extends BaseController
$this -> set_message(1001, "fail", "登录数据不能为空");
}
$log['uid'] = 0;
/* $log['uid'] = 0;
$log['game_id'] = $user['game_id'];
$log['type'] = 3;
$log['action'] = json_encode($user); // 请求参数
$log['action'] = json_encode($user); // 请求参数 */
$ip = get_client_ip();
$device_bans_ip = M('device_bans','tab_')->where(['tag' => $ip,'type' => 2])->find();
$device_bans_num = M('device_bans','tab_')->where(['tag' => $user['unique_code'],'type' => 1])->find();
if(!empty($device_bans_ip) || !empty($device_bans_num)){
$log['remarks'] = '设备已被禁用';
log_action($log);
/* $log['remarks'] = '设备已被禁用';
log_action($log); */
$this->set_message(1004, "fail", "设备已被禁用");
}
@ -58,13 +58,13 @@ class UserController extends BaseController
$res_msg = array();
switch ($result) {
case - 1:
$log['remarks'] = '用户不存在或被禁用';
log_action($log);
// $log['remarks'] = '用户不存在或被禁用';
// log_action($log);
$this -> set_message(1004, "fail", "用户不存在或被禁用");
break;
case - 2:
$log['remarks'] = '密码错误';
log_action($log);
// $log['remarks'] = '密码错误';
// log_action($log);
$this -> set_message(1005, "fail", "密码错误");
break;
default:
@ -105,13 +105,13 @@ class UserController extends BaseController
'notice_count' => $notice_count,
);
} else {
$log['remarks'] = '未知错误';
log_action($log);
// $log['remarks'] = '未知错误';
// log_action($log);
$this -> set_message(1028, "fail", "未知错误");
}
break;
}
log_action($log);
// log_action($log);
echo base64_encode(json_encode($res_msg));
die;
@ -138,13 +138,13 @@ class UserController extends BaseController
$res_msg = array();
switch ($result) {
case - 1:
$log['remarks'] = '用户不存在或被禁用';
log_action($log);
// $log['remarks'] = '用户不存在或被禁用';
// log_action($log);
$this -> set_message(1004, "fail", "用户不存在或被禁用");
break;
case - 2:
$log['remarks'] = '密码错误';
log_action($log);
// $log['remarks'] = '密码错误';
// log_action($log);
$this -> set_message(1005, "fail", "密码错误");
break;
default:
@ -195,19 +195,19 @@ class UserController extends BaseController
'request_count' => $buddies_request,
);
} else {
$log['remarks'] = '未知错误';
log_action($log);
// $log['remarks'] = '未知错误';
// log_action($log);
$this -> set_message(1028, "fail", "未知错误");
}
break;
}
log_action($log);
// log_action($log);
echo base64_encode(json_encode($res_msg));
die;
} else {
$log['remarks'] = '账号已存在';
log_action($log);
// $log['remarks'] = '账号已存在';
// log_action($log);
$this -> set_message(1004, "账号已存在");
}
@ -219,13 +219,13 @@ class UserController extends BaseController
$res_msg = array();
switch ($result) {
case - 1:
$log['remarks'] = '用户不存在或被禁用';
log_action($log);
// $log['remarks'] = '用户不存在或被禁用';
// log_action($log);
$this -> set_message(1004, "fail", "用户不存在或被禁用");
break;
case - 2:
$log['remarks'] = '密码错误';
log_action($log);
// $log['remarks'] = '密码错误';
// log_action($log);
$this -> set_message(1005, "fail", "密码错误");
break;
default:
@ -274,24 +274,24 @@ class UserController extends BaseController
'request_count' => $buddies_request,
);
} else {
$log['remarks'] = '未知错误';
$log['uid'] = $user["user_id"];
log_action($log);
// $log['remarks'] = '未知错误';
// $log['uid'] = $user["user_id"];
// log_action($log);
$this -> set_message(1028, "fail", "未知错误");
}
break;
}
//同步ucenter注册
cus_uc_register($username, $password, $username . '@vlcms.com');
log_action($log);
// log_action($log);
echo base64_encode(json_encode($res_msg));
die;
} elseif ($uc_uid == - 2) {
//密码错误
$log['remarks'] = '密码错误';
log_action($log);
// $log['remarks'] = '密码错误';
// log_action($log);
$this -> set_message(1005, "fail", "密码错误");
} else {
//登录失败
@ -304,13 +304,13 @@ class UserController extends BaseController
switch ($result) {
case - 1:
$log['remarks'] = '扶持号被禁用';
log_action($log);
// $log['remarks'] = '扶持号被禁用';
// log_action($log);
$this -> set_message(1005, "fail", "密码错误");
break;
case - 2:
$log['remarks'] = '密码错误';
log_action($log);
// $log['remarks'] = '密码错误';
// log_action($log);
$this -> set_message(1005, "fail", "密码错误");
break;
default:
@ -439,8 +439,8 @@ class UserController extends BaseController
}
} else {
$log['remarks'] = '未知错误';
log_action($log);
// $log['remarks'] = '未知错误';
// log_action($log);
$this -> set_message(1028, "fail", "未知错误");
}
@ -448,7 +448,7 @@ class UserController extends BaseController
}
$log['uid'] = $user['user_id'];
log_action($log);
// log_action($log);
echo base64_encode(json_encode($res_msg));
@ -2471,11 +2471,12 @@ class UserController extends BaseController
'lpuid' => $user['puid'],
);
$log['uid'] = $user['id'];
// 下线行为日志 不记录
/* $log['uid'] = $user['id'];
$log['game_id'] = $request['game_id'];
$log['action'] = json_encode($request);
$log['type'] = 4;
log_action($log);
log_action($log); */
/* // $return = M('UserLoginRecord', 'tab_') -> add($da);
$model = M('UserLoginRecord', 'tab_')->where(['user_id' => $user['id'],'game_id' => $request['game_id']])->order('id DESC')->find();

Loading…
Cancel
Save