Skip to content

Let's use AI to Earn!

feat: 测试页面

牛文政899c2d398be0
diff --git a/src/api/tools.ts b/src/api/tools.ts
index 5e61c7da..a667312a 100644
--- a/src/api/tools.ts
+++ b/src/api/tools.ts
@@ -67,14 +67,23 @@ export const toolsApi = {
},
/**
- * 生成AI的html图文
+ * 生成AI的html图文 弃用: 时间太长得走sse
*/
- aiArticleHtml(data: { content: string }) {
- return http.post<string>('/tools/ai/article/html', data, {
- isToken: true,
- });
+ aiArticleHtml(content: string) {
+ return http.post<string>(
+ '/tools/ai/article/html',
+ {
+ content,
+ },
+ {
+ isToken: true,
+ },
+ );
},
+ // TODO: sse生成AI的html图文
+ // /tools/ai/article/html/sse
+
/**
* 上传文件
*/
diff --git a/src/views/test/index.tsx b/src/views/test/index.tsx
index fc79f9f3..c34e0cc9 100644
--- a/src/views/test/index.tsx
+++ b/src/views/test/index.tsx
@@ -6,13 +6,17 @@
* @Description: 测试页面
*/
import { Button } from 'antd';
-import { userApi } from '@/api/user';
+import { toolsApi } from '@/api/tools';
export default function Test() {
async function testBtn() {
- userApi.getMinePopularizeCode().then((res) => {
- console.log('----------', res);
- });
+ toolsApi
+ .aiArticleHtml(
+ '主图使用该图片https://ai-to-earn.oss-cn-beijing.aliyuncs.com/development/temp/nopath/202504/d8a3278e-fd0c-42cf-8339-02bf85b6c4e4.png生成一个卡通任务介绍页',
+ )
+ .then((res) => {
+ console.log('----------', res);
+ });
}
return (