feat: 任命/撤销通知系统 + 用户名片UI优化
- 任命/撤销事件增加 type 字段区分类型 - 任命:全屏礼花 + 紫色弹窗 + 紫色系统消息 - 撤销:灰色弹窗 + 灰色系统消息,无礼花 - 消息分发:操作者/被操作者显示在私聊面板,其他人显示在公屏 - 系统消息加随机鼓励语(各5条轮换) - ChatStateService 修复 Redis key 前缀扫描问题(getAllActiveRoomIds) - 用户名片折叠优化:管理员视野、职务履历均可折叠 - 管理操作 + 职务操作合并为「🔧 管理操作」折叠区 - 悄悄话改为「🎁 送礼物」按钮,礼物面板内联展开
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
|
||||
class SendMessageRequest extends FormRequest
|
||||
{
|
||||
@@ -45,4 +47,16 @@ class SendMessageRequest extends FormRequest
|
||||
'content.max' => '发言内容不能超过 500 个字符。',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 重写验证失败的处理,无论如何(就算未按 ajax 标准提交)都必须抛出 JSON,不可以触发网页重定向去走 GET 请求而引发 302 方法错误
|
||||
*/
|
||||
protected function failedValidation(Validator $validator)
|
||||
{
|
||||
throw new HttpResponseException(response()->json([
|
||||
'status' => 'error',
|
||||
'message' => $validator->errors()->first(),
|
||||
'errors' => $validator->errors(),
|
||||
], 422));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user