|
@@ -65,11 +65,14 @@ class SensitiveMiddleware implements MiddlewareInterface
|
|
// continue;
|
|
// continue;
|
|
// }
|
|
// }
|
|
if (str_contains($concatenated, $badWord)) {
|
|
if (str_contains($concatenated, $badWord)) {
|
|
- return $this->response->raw(json_encode([
|
|
|
|
- 'code' => 0,
|
|
|
|
- 'data' => [],
|
|
|
|
- 'message' => '发现违禁词: ' . $badWord
|
|
|
|
- ]));
|
|
|
|
|
|
+ $message = '发现违禁词: '. $badWord;
|
|
|
|
+ return $this->response->json(
|
|
|
|
+ [
|
|
|
|
+ 'code' => 0,
|
|
|
|
+ 'data' => [$message],
|
|
|
|
+ 'message' => "该内容存在非法信息,请修改后重新发布"
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|