{"id":18600573,"url":"https://github.com/houbb/sensitive-word-admin","last_synced_at":"2026-01-26T20:12:34.885Z","repository":{"id":219767073,"uuid":"383743066","full_name":"houbb/sensitive-word-admin","owner":"houbb","description":"The sensitive tool admin.(敏感词工具对应的控台)","archived":false,"fork":false,"pushed_at":"2025-05-10T06:53:12.000Z","size":11967,"stargazers_count":51,"open_issues_count":0,"forks_count":26,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-13T14:32:43.842Z","etag":null,"topics":["admin","client","sensitive","sensitive-data","sensitive-word","server"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/houbb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-07T09:25:26.000Z","updated_at":"2025-05-11T00:00:33.000Z","dependencies_parsed_at":"2024-11-02T15:25:08.550Z","dependency_job_id":"606278b3-dea8-41c6-b38a-26e9095d5a04","html_url":"https://github.com/houbb/sensitive-word-admin","commit_stats":null,"previous_names":["houbb/sensitive-word-admin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/houbb/sensitive-word-admin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fsensitive-word-admin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fsensitive-word-admin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fsensitive-word-admin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fsensitive-word-admin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houbb","download_url":"https://codeload.github.com/houbb/sensitive-word-admin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houbb%2Fsensitive-word-admin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28787198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin","client","sensitive","sensitive-data","sensitive-word","server"],"created_at":"2024-11-07T02:04:29.024Z","updated_at":"2026-01-26T20:12:34.874Z","avatar_url":"https://github.com/houbb.png","language":"Java","readme":"# 项目介绍\n\n## 平台简介\n\n[sensitive-word-admin](https://github.com/houbb/sensitive-word-admin) 是和 [sensitive-word](https://github.com/houbb/sensitive-word) 配套使用的控台。\n\n为了实现一个让用户开箱即用的敏感词控台而努力~\n\n[![Build Status](https://travis-ci.com/houbb/sensitive-word-admin.svg?branch=master)](https://travis-ci.com/houbb/sensitive-word-admin)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.houbb/sensitive-word-admin/badge.svg)](http://mvnrepository.com/artifact/com.github.houbb/sensitive-word-admin)\n[![](https://img.shields.io/badge/license-Apache2-FF0080.svg)](https://github.com/houbb/sensitive-word-admin/blob/master/LICENSE.txt)\n[![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/houbb/sensitive-word-admin)\n\n* 前端采用Vue、Element UI。\n* 后端采用Spring Boot、Spring Security、Redis \u0026 Jwt。\n* 权限认证使用Jwt，支持多终端认证系统。\n* 支持加载动态权限菜单，多方式轻松权限控制。\n* 高效率开发，使用代码生成器可以一键生成前后端代码。\n* 敏感词标签的基本管理\n\n## 变更\n\n\u003e [变更日志](https://github.com/houbb/sensitive-word-admin/blob/master/CHANGELOG.md)\n\n## 项目推荐\n\n下面是一些日志、加解密、脱敏安全相关的库推荐：\n\n| 项目                                                                    | 介绍                    |\n|:----------------------------------------------------------------------|:----------------------|\n| [sensitive-word](https://github.com/houbb/sensitive-word)             | 高性能敏感词核心库             |\n| [sensitive-word-admin](https://github.com/houbb/sensitive-word-admin) | 敏感词控台，前后端分离           |\n| [sensitive](https://github.com/houbb/sensitive)                       | 高性能日志脱敏组件             |\n| [auto-log](https://github.com/houbb/auto-log)                         | 统一日志切面组件，支持全链路traceId |\n| [encryption-local](https://github.com/houbb/encryption-local)         | 离线加密机组件               |\n| [encryption](https://github.com/houbb/encryption)         | 加密机标准API+本地客户端        |\n| [encryption-server](https://github.com/houbb/encryption-server)        | 加密机服务                 |\n\n# 本地启动\n\n## 依赖\n\nredis\n\nmysql\n\nnode\n\n## 后端\n\n2）执行 mysql 脚本\n\n登录 mysql\n\n清空库（谨慎操作，别清空了以前的数据）\n\n```\nuse test;\ndrop database sensitive_word;\n```\n\n创建库\n\n```\ncreate database sensitive_word;\nuse sensitive_word;\n```\n\n执行 sql 下的 `init.sql`+ `sensitive_word.sql`\n\n3）修改配置\n\n`application-druid.yml` 调整一下数据库链接+账户密码\n\n```yaml\nspring:\n    datasource:\n        type: com.alibaba.druid.pool.DruidDataSource\n        driverClassName: com.mysql.cj.jdbc.Driver\n        druid:\n            # 主库数据源\n            master:\n                url: jdbc:mysql://localhost:3306/sensitive_word?useUnicode=true\u0026characterEncoding=utf8\u0026zeroDateTimeBehavior=convertToNull\u0026useSSL=true\u0026serverTimezone=GMT%2B8\n                username: root\n                password: PASSWORD\n```\n\n\n运行 SpringBootApplication#main()\n\n## 前端\n\n```\ncd admin-ui\nnpm install --registry=https://registry.npm.taobao.org\nnpm run dev\n```\n\n## 登录\n\n打开浏览器，输入：http://localhost:80 （默认账户 admin/admin123）\n\n## 敏感词基本管理\n\n你可以在敏感词管理菜单，进行管理。\n\n![敏感词菜单](sensitive-word-manager-menu.png)\n\n# API\n\nApiSensitiveWordController 中包含对应的 api 方法，后续可以添加验签等校验。\n\n## 接口列表\n\n| api | 入参 | 出参 | 说明 |\n|:----|:----|:----|:------|\n| /api/sensitiveWord/contains | string | boolean | 是否包含敏感词 |\n| /api/sensitiveWord/findAll | string | `List\u003cString\u003e` | 获取所有的敏感词 |\n| /api/sensitiveWord/findFist | string | string | 获取第一个的敏感词 |\n| /api/sensitiveWord/replace | string | string | 获取替换后的结果 |\n| /api/sensitiveWord/tags | string | `Set\u003cString\u003e` | 获取敏感词的标签列表 |\n\n\n## 接口验证\n\n### token\n\n![接口验证](sensitive-word-admin-api-test.png)\n\n我们登录之后，可以获取到对应的 token。\n\n比如我们打开【系统工具】-【系统接口】，任意找一个接口，看一下对应的 Authorization\n\n比如这里就是 \n\n```\neyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiYzBjMmY0MWQtMjliMS00YzlkLWI2ZmMtNDhlZTk4MGIwZjJjIn0.67qpqIndfAd4J769ny1jqq8kEnATE9u5DbjJoMpbiMCSvAg2WaBV0b4nBjo5UxKVqcqbYgmnIN4gUi3AP2p6uw\n```\n\n### swagger 认证\n\n然后点击绿色认证按钮认证一下，输入上面的 token。\n\n就可以想基本的 swagger 一样验证接口。\n\n### curl 请求\n\n你可以本地直接 curl\n\n```\ncurl -X GET \"http://localhost:80/dev-api/api/sensitiveWord/tags?text=%E4%BA%8C%E5%8D%81%E5%85%AB%E7%94%BB%E7%94%9F\" -H \"accept: */*\" -H \"Authorization: eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiYzBjMmY0MWQtMjliMS00YzlkLWI2ZmMtNDhlZTk4MGIwZjJjIn0.67qpqIndfAd4J769ny1jqq8kEnATE9u5DbjJoMpbiMCSvAg2WaBV0b4nBjo5UxKVqcqbYgmnIN4gUi3AP2p6uw\"\n```\n\n结果：\n\n```\n{\n  \"respCode\": \"0000\",\n  \"respMessage\": \"成功\",\n  \"result\": [\n    \"伟人\",\n    \"画家\"\n  ]\n}\n```\n\n\n\n# 如何自定义标签\n\n## 自定义单词 TAG\n\n我们在配置中指定：\n\n```java\n@Configuration\npublic class SensitiveWordConfig {\n\n    @Autowired\n    private MyDdWordAllow myDdWordAllow;\n\n    @Autowired\n    private MyDdWordDeny myDdWordDeny;\n\n    /**\n     * 自定义单词标签\n     *\n     * @since v1.4.0\n     */\n    @Autowired\n    private MyDdWordTags myDdWordTags;\n\n    /**\n     * 初始化引导类\n     * @return 初始化引导类\n     * @since 1.0.0\n     */\n    @Bean\n    public SensitiveWordBs sensitiveWordBs() {\n        return SensitiveWordBs.newInstance()\n                .wordAllow(WordAllows.chains(WordAllows.defaults(), myDdWordAllow))\n                .wordDeny(WordDenys.chains(WordDenys.defaults(), myDdWordDeny))\n                .wordTag(myDdWordTags)\n                // 各种其他配置\n                .init();\n    }\n\n}\n```\n\n## MyDdWordTags 自定义实现\n\nMyDdWordTags 是一个实现的例子：\n\n核心分为两步：\n\n1）根据【标签单词映射表】获取单词对应的标签编码(tag_code) 列表\n\n2）根据【标签表】中的 tag_code 去查询对应的 标签描述(tag_label) 列表\n\n所以需要分别配置二者，然后进行关联。\n\n```sql\nSELECT DISTINCT\nmapping.word AS word,\ntag.tag_label AS tagLabel\nFROM word_tag_mapping mapping\nINNER JOIN tag tag ON mapping.tag_code = tag.tag_code\nWHERE tag.status = 'Y'\n```\n\n# road-map\n\n当然，v2.0.0 出版的能力还比较欠缺，用户体验还是不够友好。\n\n感兴趣的小伙伴也可以针对下面的需求进行 PR，[欢迎一起交流](https://mp.weixin.qq.com/s/rkSvXxiiLGjl3S-ZOZCr0Q)。\n\n如果你有需求，可以去这里[issues](https://github.com/houbb/sensitive-word-admin/issues)\n\n## 待改进点\n\n- [ ] 单个词的修改实时生效\n- [ ] word/tags 的修改，增量的变化，而不是全量\n- [ ] word-tag 的处理，改为枚举映射，而不是手动输入\n- [ ] 限定接入系统 appKey appSecret\n- [ ] 系统的调用记录\n- [ ] 数据大盘\n- ~~[ ] word 操作时对应的日志表，有必要存在吗？(可以不保留，ruoyi 本身就有操作日志)~~\n\n# 技术鸣谢\n\n- 感谢 ruoyi-vue 的无私奉献\n\n\n# 拓展阅读\n\n[sensitive-word-admin v1.3.0 发布 如何支持分布式部署？](https://mp.weixin.qq.com/s/4wia8SlQQbLV5_OHplaWvg)\n\n[sensitive-word-admin 敏感词控台 v1.2.0 版本开源](https://mp.weixin.qq.com/s/7wSy0PuJLTudEo9gTY5s5w)\n\n[sensitive-word 基于 DFA 算法实现的高性能敏感词工具介绍](https://mp.weixin.qq.com/s/OKLCWlOTv_PSi9MIfDpoMw)\n\n[更多技术交流](https://mp.weixin.qq.com/s/rkSvXxiiLGjl3S-ZOZCr0Q)\n\n# 开源矩阵\n\n[sensitive-word 敏感词](https://github.com/houbb/sensitive-word)\n\n[pinyin 汉字转拼音](https://github.com/houbb/pinyin)\n\n[pinyin2hanzi 拼音转汉字](https://github.com/houbb/pinyin2hanzi)\n\n[segment 高性能中文分词](https://github.com/houbb/segment)\n\n[opencc4j 中文繁简体转换](https://github.com/houbb/opencc4j)\n\n[nlp-hanzi-similar 汉字相似度](https://github.com/houbb/nlp-hanzi-similar)\n\n[word-checker 拼写检测](https://github.com/houbb/word-checker)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoubb%2Fsensitive-word-admin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoubb%2Fsensitive-word-admin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoubb%2Fsensitive-word-admin/lists"}