Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 内容安全检测
牛文政b2a97041b0f1
diff --git a/src/api/tools.ts b/src/api/tools.tsindex a2f6fcd2..1d29f982 100644--- a/src/api/tools.ts+++ b/src/api/tools.ts@@ -95,4 +95,19 @@ export const toolsApi = {},});},++ /**+ * 文本内容安全+ */+ textModeration(content: string) {+ return http.post<string>(+ '/tools/common/text/moderation',+ {+ content,+ },+ {+ isToken: true,+ },+ );+ },};diff --git a/src/router/index.tsx b/src/router/index.tsxindex 721982b2..c385a1a5 100644--- a/src/router/index.tsx+++ b/src/router/index.tsx@@ -159,11 +159,6 @@ export const router: CustomRouteObject[] = [],},// {- // path: '/interaction',- // element: <Interaction />,- // meta: { name: '互动', icon: ShopOutlined },- // },- // {// path: '/test',// element: <Test />,// meta: { name: '测试', icon: ShopOutlined },diff --git a/src/views/test/index.tsx b/src/views/test/index.tsxindex c592bd38..de9be25a 100644--- a/src/views/test/index.tsx+++ b/src/views/test/index.tsx@@ -5,21 +5,21 @@* @LastEditors: nevin* @Description: 测试页面*/+import { toolsApi } from '@/api/tools';import { Button } from 'antd';export default function Test() {- async function getLogFilePathList() {- const res = await window.ipcRenderer.invoke('ICP_GET_FILE_MATE_INFO');- console.log('-----', res);+ async function testBtn() {+ toolsApi.textModeration('嫖娼去');}return (<div><ButtononClick={() => {- getLogFilePathList();+ testBtn();}}>- 测试事件+ 测试</Button></div>);