|
@@ -4,6 +4,7 @@ import { ProxyService } from '../service/proxy.service';
|
|
|
import { SingleSignOnService } from '../service/singleSignOn.service';
|
|
|
import { PermissionService } from '../service/permission.service';
|
|
|
import { PemService } from '../service/pem.service';
|
|
|
+import SensitiveWordTool from 'sensitive-word-tool';
|
|
|
@Controller('/cxyy/api')
|
|
|
export class HomeController {
|
|
|
@Inject()
|
|
@@ -26,6 +27,16 @@ export class HomeController {
|
|
|
return 'proxy starting....';
|
|
|
}
|
|
|
|
|
|
+ @Get('/test')
|
|
|
+ async test(): Promise<string> {
|
|
|
+ const sensitiveWordTool = new SensitiveWordTool({
|
|
|
+ useDefaultWords: true,
|
|
|
+ });
|
|
|
+ const str = '<p>在群里,我们不能讨论有关于党,d,国家,gj,政府,zf,不能建政,jz,不能搞黄色,淫秽色情</p>';
|
|
|
+ const res = sensitiveWordTool.filter(str);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
@Get('/initKeys')
|
|
|
async makePairCrypto() {
|
|
|
await this.pemService.createKeys();
|