推送信息变化

This commit is contained in:
2025-11-17 14:33:50 +08:00
parent 15df770071
commit b102995ab1
2 changed files with 14 additions and 3 deletions

View File

@@ -17,8 +17,13 @@ class Login extends Model
if ($block) { if ($block) {
return ['code' => 0, 'msg' => '设备已被封禁', 'data' => null]; return ['code' => 0, 'msg' => '设备已被封禁', 'data' => null];
} }
$ip = request()->ip(); //获取请求ip
$block = db::name('block')->where(['type_text' => $ip,'type' => 3])->find(); $login_ip = request()->server('HTTP_X_REAL_IP') ?: request()->server('HTTP_X_FORWARDED_FOR') ?: request()->ip();
if (empty($login_ip)) {
return ['code' => 0, 'msg' => '无法获取客户端IP地址', 'data' => null];
}
$block = db::name('block')->where(['type_text' => $login_ip,'type' => 3])->find();
if ($block) { if ($block) {
return ['code' => 0, 'msg' => 'ip已被封禁', 'data' => null]; return ['code' => 0, 'msg' => 'ip已被封禁', 'data' => null];
} }
@@ -30,7 +35,7 @@ class Login extends Model
$data['username'] = $user_name; $data['username'] = $user_name;
$data['mobile'] = $user_name; $data['mobile'] = $user_name;
$data['nickname'] = '游客'.$user_code; $data['nickname'] = '游客'.$user_code;
$data['joinip'] = request()->ip(); $data['joinip'] = $login_ip;
$data['birthday'] = date('Y-m-d'); $data['birthday'] = date('Y-m-d');
$data['avatar'] = get_system_config_value('web_site').'/data/avatar/head_pic.png'; $data['avatar'] = get_system_config_value('web_site').'/data/avatar/head_pic.png';
$data['profile'] = '这个人很懒,什么都没写'; $data['profile'] = '这个人很懒,什么都没写';

View File

@@ -375,6 +375,12 @@ class SingerSong extends Model
model('Chat')->sendMsg(1071,$next_song_info['room_id'],$data); model('Chat')->sendMsg(1071,$next_song_info['room_id'],$data);
}else{ }else{
$song_info_data = [
'text' => '房间当前演唱歌曲变化',
'song_info' => null
];
model('Chat')->sendMsg(1070,$sonng_log['room_id'],$song_info_data);
$data = [ $data = [
'text' => '房间下一首演唱歌曲变化', 'text' => '房间下一首演唱歌曲变化',
'next_song_info' => null 'next_song_info' => null