Skip to content

Let's use AI to Earn!

feat: 1. 删除demo。 2. 优化站点地图

gaoSir1bd37936145c
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f59bcc11..1512fc2f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,24 +4,21 @@
<option name="autoReloadType" value="NONE" />
</component>
<component name="ChangeListManager">
- <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="feat(热门内容): 添加小红书作者跳转">
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/aiRank.module.scss" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/aiRanking/aiRanking.module.scss" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/aiRanking/echarts-weekPie.ts" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/aiRanking/page.tsx" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/components/CycleSelects/cycleSelects.module.scss" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/components/CycleSelects/index.tsx" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/components/RankingTags/index.tsx" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/components/RankingTags/rankingTags.module.scss" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/images/bg-rank-index.png" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/layout.tsx" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/page.tsx" afterDir="false" />
- <change afterPath="$PROJECT_DIR$/src/app/[lng]/aiRank/svgs/ranking.svg" afterDir="false" />
+ <list default="true" id="8ce961ad-7c9e-494c-bc53-9ecde4358af8" name="更改" comment="fix: 热门内容边界处理">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/@types/resources.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/@types/resources.d.ts" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/i18n/locales/en/route.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/i18n/locales/en/route.json" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/i18n/locales/zh-CN/route.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/i18n/locales/zh-CN/route.json" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/src/app/layout/routerData.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/app/layout/routerData.ts" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/next-sitemap.config.js" beforeDir="false" afterPath="$PROJECT_DIR$/next-sitemap.config.js" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/public/robots.txt" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/public/sitemap.xml" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoContent.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoData.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoIncome.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoInteract.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoNote.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoPublish.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/demoTask.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/ipTest.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/page.tsx" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/src/app/[lng]/demo/uploadExample.tsx" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -64,7 +61,7 @@
}
}</component>
<component name="ProblemsViewState">
- <option name="selectedTabId" value="ProjectErrors" />
+ <option name="selectedTabId" value="CurrentFile" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 4
@@ -77,48 +74,48 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
- <component name="PropertiesComponent"><![CDATA[{
- "keyToString": {
- "ASKED_ADD_EXTERNAL_FILES": "true",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder0": "0",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder1": "1",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder2": "2",
- "FileHistory.git4idea.history.GitHistoryProvider_flatOrder3": "3",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth0": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth1": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth2": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_flatWidth3": "449",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder0": "0",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder1": "1",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder2": "2",
- "FileHistory.git4idea.history.GitHistoryProvider_treeOrder3": "3",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth0": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth1": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth2": "450",
- "FileHistory.git4idea.history.GitHistoryProvider_treeWidth3": "449",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "RunOnceActivity.cidr.known.project.marker": "true",
- "RunOnceActivity.readMode.enableVisualFormatting": "true",
- "cf.first.check.clang-format": "false",
- "cidr.known.project.marker": "true",
- "dart.analysis.tool.window.visible": "false",
- "git-widget-placeholder": "main",
- "ignore.virus.scanning.warn.message": "true",
- "kotlin-language-version-configured": "true",
- "last_opened_file_path": "E:/project-dev/web/艺咖/aitoearn-web/src/app/[lng]/aiRank",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.standard": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.standard": "",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "preferences.pluginManager",
- "show.migrate.to.gradle.popup": "false",
- "ts.external.directory.path": "E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib",
- "vue.rearranger.settings.migration": "true"
+ <component name="PropertiesComponent">{
+ &quot;keyToString&quot;: {
+ &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder0&quot;: &quot;0&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder1&quot;: &quot;1&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder2&quot;: &quot;2&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatOrder3&quot;: &quot;3&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth0&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth1&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth2&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_flatWidth3&quot;: &quot;449&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder0&quot;: &quot;0&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder1&quot;: &quot;1&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder2&quot;: &quot;2&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeOrder3&quot;: &quot;3&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth0&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth1&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth2&quot;: &quot;450&quot;,
+ &quot;FileHistory.git4idea.history.GitHistoryProvider_treeWidth3&quot;: &quot;449&quot;,
+ &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+ &quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;,
+ &quot;RunOnceActivity.readMode.enableVisualFormatting&quot;: &quot;true&quot;,
+ &quot;cf.first.check.clang-format&quot;: &quot;false&quot;,
+ &quot;cidr.known.project.marker&quot;: &quot;true&quot;,
+ &quot;dart.analysis.tool.window.visible&quot;: &quot;false&quot;,
+ &quot;git-widget-placeholder&quot;: &quot;main&quot;,
+ &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
+ &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
+ &quot;last_opened_file_path&quot;: &quot;E:/project-dev/web/艺咖/aitoearn-web/src/app/[lng]/aiRank&quot;,
+ &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
+ &quot;node.js.detected.package.standard&quot;: &quot;true&quot;,
+ &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
+ &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
+ &quot;node.js.selected.package.standard&quot;: &quot;&quot;,
+ &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
+ &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
+ &quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;,
+ &quot;show.migrate.to.gradle.popup&quot;: &quot;false&quot;,
+ &quot;ts.external.directory.path&quot;: &quot;E:\\project-dev\\web\\艺咖\\aitoearn-web\\node_modules\\typescript\\lib&quot;,
+ &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
-}]]></component>
+}</component>
<component name="ReactBuddySettings">
<option name="extensionsIgnore" value="true" />
</component>
@@ -231,46 +228,10 @@
<workItem from="1757990250575" duration="77000" />
<workItem from="1758007785895" duration="36707000" />
<workItem from="1758107883444" duration="5630000" />
- </task>
- <task id="LOCAL-00029" summary="feat: 尝试多语言SEO优化,添加静态站点配置">
- <option name="closed" value="true" />
- <created>1752575382612</created>
- <option name="number" value="00029" />
- <option name="presentableId" value="LOCAL-00029" />
- <option name="project" value="LOCAL" />
- <updated>1752575382612</updated>
- </task>
- <task id="LOCAL-00030" summary="fix: 解决404问题">
- <option name="closed" value="true" />
- <created>1752631493942</created>
- <option name="number" value="00030" />
- <option name="presentableId" value="LOCAL-00030" />
- <option name="project" value="LOCAL" />
- <updated>1752631493942</updated>
- </task>
- <task id="LOCAL-00031" summary="chore: b站校验优化">
- <option name="closed" value="true" />
- <created>1753151102359</created>
- <option name="number" value="00031" />
- <option name="presentableId" value="LOCAL-00031" />
- <option name="project" value="LOCAL" />
- <updated>1753151102359</updated>
- </task>
- <task id="LOCAL-00032" summary="fix(发布): usePubParamsVerify参数校验优化">
- <option name="closed" value="true" />
- <created>1753151560507</created>
- <option name="number" value="00032" />
- <option name="presentableId" value="LOCAL-00032" />
- <option name="project" value="LOCAL" />
- <updated>1753151560507</updated>
- </task>
- <task id="LOCAL-00033" summary="fix(seo): 站点地图修复">
- <option name="closed" value="true" />
- <created>1753265975510</created>
- <option name="number" value="00033" />
- <option name="presentableId" value="LOCAL-00033" />
- <option name="project" value="LOCAL" />
- <updated>1753265975510</updated>
+ <workItem from="1758384058524" duration="10000" />
+ <workItem from="1758505349114" duration="516000" />
+ <workItem from="1758510004297" duration="4147000" />
+ <workItem from="1758514243321" duration="6110000" />
</task>
<task id="LOCAL-00034" summary="fix(日历):发布时间格式修复">
<option name="closed" value="true" />
@@ -624,7 +585,47 @@
<option name="project" value="LOCAL" />
<updated>1758275776107</updated>
</task>
- <option name="localTasksCounter" value="78" />
+ <task id="LOCAL-00078" summary="feat: 添加Ai工具排行榜">
+ <option name="closed" value="true" />
+ <created>1758282359740</created>
+ <option name="number" value="00078" />
+ <option name="presentableId" value="LOCAL-00078" />
+ <option name="project" value="LOCAL" />
+ <updated>1758282359740</updated>
+ </task>
+ <task id="LOCAL-00079" summary="feat: 优化ConditionalHeader的匹配规则">
+ <option name="closed" value="true" />
+ <created>1758282685389</created>
+ <option name="number" value="00079" />
+ <option name="presentableId" value="LOCAL-00079" />
+ <option name="project" value="LOCAL" />
+ <updated>1758282685389</updated>
+ </task>
+ <task id="LOCAL-00080" summary="feat: 热门内容添加微信公众号跳转到作品">
+ <option name="closed" value="true" />
+ <created>1758285846264</created>
+ <option name="number" value="00080" />
+ <option name="presentableId" value="LOCAL-00080" />
+ <option name="project" value="LOCAL" />
+ <updated>1758285846264</updated>
+ </task>
+ <task id="LOCAL-00081" summary="feat: 热门内容详情开发中">
+ <option name="closed" value="true" />
+ <created>1758287993125</created>
+ <option name="number" value="00081" />
+ <option name="presentableId" value="LOCAL-00081" />
+ <option name="project" value="LOCAL" />
+ <updated>1758287993125</updated>
+ </task>
+ <task id="LOCAL-00082" summary="fix: 热门内容边界处理">
+ <option name="closed" value="true" />
+ <created>1758288596853</created>
+ <option name="number" value="00082" />
+ <option name="presentableId" value="LOCAL-00082" />
+ <option name="project" value="LOCAL" />
+ <updated>1758288596853</updated>
+ </task>
+ <option name="localTasksCounter" value="83" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -675,11 +676,6 @@
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" />
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
- <MESSAGE value="feat(数据统计): echarts图接入API" />
- <MESSAGE value="feat(数据统计): 数据大体完成" />
- <MESSAGE value="feat(数据统计): 1. 添加账号搜索功能。 2. 添加账号离线状态和重新登录。" />
- <MESSAGE value="feat(数据统计): 优化" />
- <MESSAGE value="feat(数据统计): 国际化处理完成" />
<MESSAGE value="feat(数据统计): 1. echarts图优化。 2. 平台名称进行国际化。" />
<MESSAGE value="feat(数据统计): 添加昨日新增" />
<MESSAGE value="feat(热门内容): 恢复新热门内容" />
@@ -700,6 +696,11 @@
<MESSAGE value="feat(热点): 1. 处理爆款标题国际化。 2. 修复爆款标题label在“全部”切换日期不会刷新数据的bug" />
<MESSAGE value="feat: 国际化改回来" />
<MESSAGE value="feat(热门内容): 添加小红书作者跳转" />
- <option name="LAST_COMMIT_MESSAGE" value="feat(热门内容): 添加小红书作者跳转" />
+ <MESSAGE value="feat: 添加Ai工具排行榜" />
+ <MESSAGE value="feat: 优化ConditionalHeader的匹配规则" />
+ <MESSAGE value="feat: 热门内容添加微信公众号跳转到作品" />
+ <MESSAGE value="feat: 热门内容详情开发中" />
+ <MESSAGE value="fix: 热门内容边界处理" />
+ <option name="LAST_COMMIT_MESSAGE" value="fix: 热门内容边界处理" />
</component>
</project>
\ No newline at end of file
diff --git a/next-sitemap.config.js b/next-sitemap.config.js
index b777c7d5..aec22de8 100644
--- a/next-sitemap.config.js
+++ b/next-sitemap.config.js
@@ -1,73 +1,109 @@
+// next-sitemap.config.js
const glob = require("glob");
+const { statSync } = require("fs");
+const path = require("path");
+
+const BLOCKLIST_REGEX = /material\/album\/\[id\]/;
+const HAS_DYNAMIC_SEGMENT = /\[[^/]+?\]/;
+const siteUrl = "https://aitoearn.ai";
/** @type {import('next-sitemap').IConfig} */
module.exports = {
- siteUrl: process.env.NEXT_PUBLIC_HOST_URL,
+ siteUrl,
generateRobotsTxt: true,
sitemapSize: 7000,
- transform: async (config, path) => {
- if (path.includes("[lng]")) {
- return null;
- }
+ // 主站 URL 生成(保持你现有逻辑,可继续优化)
+ transform: async (_, locPath) => {
+ if (HAS_DYNAMIC_SEGMENT.test(locPath)) return null;
+ if (BLOCKLIST_REGEX.test(locPath)) return null;
+ if (locPath.includes("[lng]")) return null;
return {
- loc: path,
- changefreq: config.changefreq,
- priority: config.priority,
- lastmod: config.autoLastmod ? new Date().toISOString() : undefined,
+ loc: locPath,
+ changefreq: "monthly",
+ priority: 0.7,
+ lastmod: new Date().toISOString(),
};
},
additionalPaths: async () => {
const languages = ["en", "zh-CN"];
-
- // 找到所有 page 文件,然后过滤
const allPageFiles = glob.sync("src/app/**/page.{js,tsx}", {
cwd: process.cwd(),
ignore: ["**/node_modules/**"],
});
- // 过滤出 [lng] 目录下的文件
- const pageFiles = allPageFiles.filter((file) => file.includes("[lng]"));
-
- // 转换为路由路径
- const routes = pageFiles.map((file) => {
- let route = file
- .replace(/\\/g, "/") // 将反斜杠转为正斜杠
- .replace("/page.tsx", "") // 移除 page.tsx
- .replace("src/app/[lng]", ""); // 移除前缀
+ const pageFiles = allPageFiles
+ .filter((f) => f.includes("[lng]"))
+ .filter((f) => {
+ const unix = f.replace(/\\/g, "/");
+ if (BLOCKLIST_REGEX.test(unix)) return false;
+ const withoutLng = unix.replace("/[lng]", "");
+ return !HAS_DYNAMIC_SEGMENT.test(withoutLng);
+ });
- return route || "/";
+ const routeEntries = pageFiles.map((file) => {
+ let route =
+ file
+ .replace(/\\/g, "/")
+ .replace(/\/page\.(js|tsx)$/, "")
+ .replace("src/app/[lng]", "") || "/";
+ if (route !== "/") route = route.replace(/^\/+/, "/");
+ const lastmod = statSync(path.resolve(file)).mtime.toISOString();
+ return { route, lastmod };
});
const result = [];
+
for (const lang of languages) {
- for (const routePath of routes) {
+ for (const { route, lastmod } of routeEntries) {
+ const isRoot = route === "/";
+ const slug = isRoot ? "" : route.slice(1);
+ const normalized = slug;
+
+ let changefreq = "monthly";
+ let priority = isRoot ? 0.8 : 0.7;
+ if (normalized.includes("hotContent")) {
+ changefreq = "daily";
+ priority = 0.9;
+ } else if (normalized.includes("aiRank")) {
+ changefreq = "weekly";
+ priority = 0.9;
+ }
+
result.push({
- loc: `/${lang}/${routePath}`,
- changefreq: "daily",
- priority: routePath === "/" ? 1.0 : 0.8,
- alternateRefs: languages.map((alternateLang) => ({
- href: `https://apitest.aiearn.ai/${alternateLang}${routePath === "/" ? "" : routePath}`,
- hreflang: alternateLang,
- })),
+ loc: `/${lang}${slug ? "/" + slug : ""}`,
+ changefreq,
+ priority,
+ lastmod,
});
}
}
- // 添加额外的静态页面
- const extraRoute = [
- "https://blog.aitoearn.ai/",
- "https://docs.aitoearn.ai/",
- ];
- for (const url of extraRoute) {
- result.push({
- loc: url,
- changefreq: "daily",
- priority: 0.7,
- });
- }
-
return result;
},
+
+ // 关键:把子站 sitemap 挂到索引
+ additionalSitemaps: [
+ "https://blog.aitoearn.ai/sitemap.xml",
+ "https://docs.aitoearn.ai/sitemap.xml",
+ "https://hotinfo.aitoearn.ai/sitemap.xml",
+ "https://rank.aitoearn.ai/sitemap.xml",
+ ],
+
+ // 让 robots.txt 也列出
+ robotsTxtOptions: {
+ policies: [
+ {
+ userAgent: "*",
+ disallow: [],
+ },
+ ],
+ additionalSitemaps: [
+ "https://blog.aitoearn.ai/sitemap.xml",
+ "https://docs.aitoearn.ai/sitemap.xml",
+ "https://hotinfo.aitoearn.ai/sitemap.xml",
+ "https://rank.aitoearn.ai/sitemap.xml",
+ ],
+ },
};
diff --git a/public/robots.txt b/public/robots.txt
deleted file mode 100644
index 0b2eaa56..00000000
--- a/public/robots.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# *
-User-agent: *
-Allow: /
-
-# Host
-Host: https://aitoearn.ai
-
-# Sitemaps
-Sitemap: https://aitoearn.ai/sitemap.xml
diff --git a/public/sitemap.xml b/public/sitemap.xml
deleted file mode 100644
index bb9442e3..00000000
--- a/public/sitemap.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
-<sitemap><loc>https://aitoearn.ai/sitemap-0.xml</loc></sitemap>
-</sitemapindex>
\ No newline at end of file
diff --git a/src/app/[lng]/demo/demoContent.tsx b/src/app/[lng]/demo/demoContent.tsx
deleted file mode 100644
index 4e4f5221..00000000
--- a/src/app/[lng]/demo/demoContent.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-"use client";
-import { apiGetIncomeList } from "@/api/income";
-import { apiStartMaterialTask } from "@/api/material";
-import { IncomeRecord } from "@/api/types/income";
-import { useState } from "react";
-
-export const DemoContent = () => {
- const [result, setResult] = useState<IncomeRecord[]>([]);
-
- async function startMaterialTask() {
- const res = await apiStartMaterialTask("68c93aafc4be3637b6efde96")
- console.log('----- res', res);
- }
-
-
- return (
- <div>
- <div>
- <button onClick={startMaterialTask}>生成</button>
-
- </div>
- </div>
- );
-};
diff --git a/src/app/[lng]/demo/demoData.tsx b/src/app/[lng]/demo/demoData.tsx
deleted file mode 100644
index e6f7a56a..00000000
--- a/src/app/[lng]/demo/demoData.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-"use client";
-
-import { apiGetAccountDataBulk, apiGetAccountDataCube } from "@/api/plat/dataCube";
-const account = "686bc457e9a745f012552abf";
-
-export const DemoData = () => {
- const getAccountDataCube = async () => {
- try {
- const res: any = await apiGetAccountDataCube(account);
- console.log("获取数据成功:---", res);
-
- if (res?.data?.data) {
- console.log("创建记录成功:", res.data.data);
- }
- } catch (error) {
- console.error("创建记录失败:", error);
- }
- };
-
- const getAccountDataBulk = async () => {
- try {
- const res: any = await apiGetAccountDataBulk(account);
- console.log("获取数据成功:---", res);
-
- if (res?.data?.data) {
- console.log("创建记录成功:", res.data.data);
- }
- } catch (error) {
- console.error("创建记录失败:", error);
- }
- };
-
- return (
- <div>
- <div style={{ marginTop: "20px" }}>
- <h3>数据板块测试:</h3>
- <div>
- <button onClick={getAccountDataCube}>获取账号总量数据</button>
- <button onClick={getAccountDataBulk}>获取账号增量数据</button>
- </div>
- </div>
- </div>
- );
-};
diff --git a/src/app/[lng]/demo/demoIncome.tsx b/src/app/[lng]/demo/demoIncome.tsx
deleted file mode 100644
index f02196b2..00000000
--- a/src/app/[lng]/demo/demoIncome.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-"use client";
-import { apiGetIncomeList, apiSubmitWithdraw } from "@/api/income";
-import { IncomeRecord } from "@/api/types/income";
-import { apiGetWithdrawRecordList } from "@/api/withdraw";
-import { useState } from "react";
-
-export const DemoIncome = () => {
- const [result, setResult] = useState<IncomeRecord[]>([]);
- const [userTaskList, setUserTaskList] = useState<any[]>([]);
-
- async function getIncomeList() {
- const res = await apiGetIncomeList({ pageNo: 1, pageSize: 20 }, {});
- console.log("------ createMaterialGroup ---- ", res);
- if (!res) return;
- setResult(res.data.list);
- }
-
- async function submitWithdraw(opportunityId: string) {
- console.log(`----`, opportunityId);
- const res = await apiSubmitWithdraw(opportunityId)
- console.log('----- res', res);
- }
-
-
- async function getWithdrawRecordList() {
- const res = await apiGetWithdrawRecordList({ pageNo: 1, pageSize: 20 }, {});
- console.log("------ getUserTaskList ---- ", res);
- if (!res) return;
- setUserTaskList(res.data.list);
- }
-
- return (
- <div>
- <div>
- <button onClick={getIncomeList}>我的收入列表</button>
-
- {/* 我的收入列表 */}
- <div>
-
- {result.map((item) => (
- <div key={item._id}>
- <div>{item._id}</div>
- <button onClick={() => submitWithdraw(item._id)}>申请提现</button>
- </div>
- ))}
- </div>
-
-
- <button onClick={getWithdrawRecordList}>获取我的提现列表</button>
- <div>
-
- {userTaskList.map((item) => (
- <div key={item._id}>
- <div>{item._id}</div>
- <div>{item.accountId}</div>
- <div>{item.accountType}</div>
- <div>{item.status}</div>
- </div>
- ))}
- </div>
- </div>
- </div>
- );
-};
diff --git a/src/app/[lng]/demo/demoInteract.tsx b/src/app/[lng]/demo/demoInteract.tsx
deleted file mode 100644
index 685f93c9..00000000
--- a/src/app/[lng]/demo/demoInteract.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-"use client";
-import { apiAddArcComment, apiGetArcCommentList } from "@/api/plat/interact";
-const accountId = "686bc457e9a745f012552abf";
-const dataId = "686bc457e9a745f012552abf";
-const content = "感谢各位粉丝的关注!";
-
-export const DemoInteract = () => {
- const addArcComment = async () => {
- try {
- const res: any = await apiAddArcComment({
- accountId: accountId,
- dataId,
- content,
- });
- console.log("获取数据成功:---", res);
-
- if (res?.data?.data) {
- console.log("创建记录成功:", res.data.data);
- }
- } catch (error) {
- console.error("创建记录失败:", error);
- }
- };
-
- return (
- <div>
- <div style={{ marginTop: "20px" }}>
- <h3>渠道互动测试:</h3>
- <div>
- <button onClick={addArcComment}>添加作品评论</button>
- </div>
- </div>
- </div>
- );
-};
diff --git a/src/app/[lng]/demo/demoNote.tsx b/src/app/[lng]/demo/demoNote.tsx
deleted file mode 100644
index f9f7d2b4..00000000
--- a/src/app/[lng]/demo/demoNote.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-"use client";
-
-import { getNotificationList } from "@/api/notification";
-
-export const DemoNotification = () => {
- async function doGetNotificationList() {
- const res = await getNotificationList({ page: 1, pageSize: 20 });
- console.log("------ createMaterialGroup ---- ", res);
- }
-
- return (
- <div>
- <div>========= 通知消息 ==============</div>
- <div>
- <button onClick={doGetNotificationList}>获取通知消息列表</button>
- </div>
- </div>
- );
-};
diff --git a/src/app/[lng]/demo/demoPublish.tsx b/src/app/[lng]/demo/demoPublish.tsx
deleted file mode 100644
index dfcf3b4c..00000000
--- a/src/app/[lng]/demo/demoPublish.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-"use client";
-
-import { PubType } from "@/app/config/publishConfig";
-import dayjs from "dayjs";
-import utc from "dayjs/plugin/utc";
-import { apiCreatePublish } from "@/api/plat/publish";
-import { PlatType } from "@/app/config/platConfig";
-// import timezone from "dayjs/plugin/timezone";
-
-dayjs.extend(utc);
-// dayjs.extend(timezone);
-
-export const DemoPublish = () => {
- const createPublish = async () => {
- const publishTime = dayjs().add(31, "minute").utc().format();
- try {
- const res: any = await apiCreatePublish({
- flowId: "cd296d3bda0f465f977b1cbf200e21d6",
- type: PubType.VIDEO,
- title: "测试视频标题",
- desc: "测试视频描述",
- accountId: "686ba36565c9020dc1f3a043",
- accountType: PlatType.BILIBILI,
- videoUrl:
- "https://v2-zj-bjcm.kwaicdn.com/upic/2025/06/24/09/BMjAyNTA2MjQwOTI3MjlfNDQwMjk3NjY1Nl8xNjc1OTkwOTUzNzBfMl8z_b_Bea472124f75ea09e1483d87c112ede39.mp4?tag=1-1751887066-unknown-0-uqpbdciha7-0f5473b4478e400b&provider=self&clientCacheKey=3xcwhdmk5jcyv8y_b.mp4&di=dfa08272&bp=14944&x-ks-ptid=167599095370&Aecs=172.17.4.195&ocid=100001260&tt=b&ss=vpm",
- coverUrl: "https://education.yikart.cn/images/swiper/swiper1.png",
- // imgList: ["imgList1", "imgList2"],
- publishTime,
- option: {
- isAutoPublish: true,
- isAutoDelete: true,
- isAutoCover: true,
- isAutoImg: true,
- bilibili: {
- tid: 21,
- copyright: 1,
- },
- },
- });
- if (res?.data?.data) {
- console.log("创建记录成功:", res.data.data);
- }
- } catch (error) {
- console.error("创建记录失败:", error);
- }
- };
-
- return (
- <div>
- <div>========= 发布记录 ==============</div>
- <div>
- <button onClick={createPublish}>创建记录</button>
- </div>
-
- <div style={{ marginTop: "20px" }}>
- <h3>发布记录列表组件测试:</h3>
- {/* <Page
- height="400px"
- onChange={(record) => {
- console.log('选中的记录:', record);
- }}
- /> */}
- </div>
- </div>
- );
-};
diff --git a/src/app/[lng]/demo/demoTask.tsx b/src/app/[lng]/demo/demoTask.tsx
deleted file mode 100644
index df763027..00000000
--- a/src/app/[lng]/demo/demoTask.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-"use client";
-import { apiAcceptTask, apiGetTaskOpportunityList, apiGetUserTaskList, apiSubmitTask, TaskOpportunity } from "@/api/task";
-import { useState } from "react";
-
-export const DemoTask = () => {
- const [result, setResult] = useState<TaskOpportunity[]>([]);
- const [userTaskList, setUserTaskList] = useState<any[]>([]);
-
-
-
- async function getTaskOpportunityList() {
- const res = await apiGetTaskOpportunityList({ page: 1, pageSize: 20 });
- console.log("------ createMaterialGroup ---- ", res);
- if (!res) return;
- setResult(res.data.list);
- }
-
- async function acceptTask(opportunityId: string) {
- console.log(`----`, opportunityId);
-
- const res = await apiAcceptTask(opportunityId)
- console.log('----- res', res);
- }
-
-
- async function getUserTaskList() {
- const res = await apiGetUserTaskList({ page: 1, pageSize: 20 });
- console.log("------ getUserTaskList ---- ", res);
- if (!res) return;
- setUserTaskList(res.data.list);
- }
-
-
- async function submitTask(userTaskId: string) {
- console.log(`----`, userTaskId);
-
- const res = await apiSubmitTask(userTaskId, 'https://www.baidu.com')
- console.log('----- res', res);
- }
-
-
- return (
- <div>
- <div>========= 通知消息 ==============</div>
- <div>
- <button onClick={getTaskOpportunityList}>获取发放给我的任务列表</button>
-
- {/* 待接受任务列表 */}
- <div>
-
- {result.map((item) => (
- <div key={item._id}>
- <div>{item._id}</div>
- <div>{item.accountId}</div>
- <div>{item.accountType}</div>
- <div>{item.status}</div>
- <button onClick={() => acceptTask(item._id)}>接受任务</button>
- </div>
- ))}
- </div>
-
-
- <button onClick={getUserTaskList}>获取我接受的任务列表</button>
- {/* 已接受任务列表 */}
- <div>
-
- {userTaskList.map((item) => (
- <div key={item._id}>
- <div>{item._id}</div>
- <div>{item.accountId}</div>
- <div>{item.accountType}</div>
- <div>{item.status}</div>
- <button onClick={() => submitTask(item._id)}>提交任务</button>
- </div>
- ))}
- </div>
- </div>
- </div>
- );
-};
diff --git a/src/app/[lng]/demo/ipTest.tsx b/src/app/[lng]/demo/ipTest.tsx
deleted file mode 100644
index 76dc15b0..00000000
--- a/src/app/[lng]/demo/ipTest.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * IP地理位置获取测试页面
- * 用于测试IP获取功能是否正常工作
- */
-
-import { useState } from 'react';
-import { Button, Card, Space, Typography } from 'antd';
-import { getIpLocation, IpLocationInfo } from '@/utils/ipLocation';
-
-const { Title, Text, Paragraph } = Typography;
-
-const IpTestPage = () => {
- const [ipInfo, setIpInfo] = useState<IpLocationInfo | null>(null);
- const [loading, setLoading] = useState(false);
- const [error, setError] = useState<string | null>(null);
-
- /**
- * 测试获取IP地理位置信息
- */
- const handleTestIpLocation = async () => {
- try {
- setLoading(true);
- setError(null);
- const info = await getIpLocation();
- setIpInfo(info);
- } catch (err) {
- setError(err instanceof Error ? err.message : '获取IP信息失败');
- } finally {
- setLoading(false);
- }
- };
-
- return (
- <div style={{ padding: '20px', maxWidth: '800px', margin: '0 auto' }}>
- <Title level={2}>IP地理位置获取测试</Title>
-
- <Card title="功能说明" style={{ marginBottom: '20px' }}>
- <Paragraph>
- 此页面用于测试IP地理位置获取功能。点击下方按钮将调用JSONP接口获取当前IP地址和地理位置信息。
- </Paragraph>
- <Paragraph>
- <Text code>https://ping0.cc/geo/jsonp/callback</Text> 接口将返回以下信息:
- </Paragraph>
- <ul>
- <li><Text strong>IP地址</Text>:当前访问者的公网IP地址</li>
- <li><Text strong>地理位置</Text>:IP地址对应的地理位置信息</li>
- <li><Text strong>ASN</Text>:自治系统号码</li>
- <li><Text strong>组织</Text>:网络服务提供商信息</li>
- </ul>
- </Card>
-
- <Card title="测试结果" style={{ marginBottom: '20px' }}>
- <Space direction="vertical" style={{ width: '100%' }}>
- <Button
- type="primary"
- onClick={handleTestIpLocation}
- loading={loading}
- size="large"
- >
- {loading ? '获取中...' : '获取IP地理位置信息'}
- </Button>
-
- {error && (
- <Card size="small" style={{ backgroundColor: '#fff2f0', borderColor: '#ffccc7' }}>
- <Text type="danger">错误信息:{error}</Text>
- </Card>
- )}
-
- {ipInfo && (
- <Card size="small" style={{ backgroundColor: '#f6ffed', borderColor: '#b7eb8f' }}>
- <Space direction="vertical" style={{ width: '100%' }}>
- <div>
- <Text strong>IP地址:</Text>
- <Text copyable>{ipInfo.ip}</Text>
- </div>
- <div>
- <Text strong>地理位置:</Text>
- <Text>{ipInfo.location}</Text>
- </div>
- <div>
- <Text strong>ASN:</Text>
- <Text code>{ipInfo.asn}</Text>
- </div>
- <div>
- <Text strong>组织:</Text>
- <Text>{ipInfo.org}</Text>
- </div>
- </Space>
- </Card>
- )}
- </Space>
- </Card>
-
- <Card title="技术实现" style={{ marginBottom: '20px' }}>
- <Paragraph>
- <Text strong>实现方式:</Text> 使用JSONP(JSON with Padding)技术调用第三方IP地理位置服务
- </Paragraph>
- <Paragraph>
- <Text strong>核心代码:</Text>
- </Paragraph>
- <pre style={{ backgroundColor: '#f5f5f5', padding: '10px', borderRadius: '4px' }}>
-{`// 创建动态回调函数
-const callbackName = \`ipLocationCallback_\${Date.now()}_\${Math.random()}\`;
-
-// 定义回调函数
-window[callbackName] = (ip, location, asn, org) => {
- // 处理返回的数据
- resolve({ ip, location, asn, org });
-};
-
-// 动态加载script标签
-const script = document.createElement('script');
-script.src = \`https://ping0.cc/geo/jsonp/\${callbackName}\`;
-document.head.appendChild(script);`}
- </pre>
- </Card>
- </div>
- );
-};
-
-export default IpTestPage;
diff --git a/src/app/[lng]/demo/page.tsx b/src/app/[lng]/demo/page.tsx
deleted file mode 100644
index d9c5a4fc..00000000
--- a/src/app/[lng]/demo/page.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { useTranslation } from "@/app/i18n";
-import { PageParams } from "@/app/globals";
-import * as React from "react";
-import { getMetadata } from "@/utils/general";
-import { DemoPublish } from "@/app/[lng]/demo/demoPublish";
-import { DemoData } from "./demoData";
-import { DemoInteract } from "./demoInteract";
-import { DemoNotification } from "./demoNote";
-import { DemoTask } from "./demoTask";
-import { DemoIncome } from "./demoIncome";
-import { DemoContent } from "./demoContent";
-
-export async function generateMetadata({ params }: PageParams) {
- const { lng } = await params;
- const { t } = await useTranslation(lng, "demo");
- return await getMetadata(
- {
- title: t("title"),
- },
- lng,
- );
-}
-
-export default async function Page({ params }: PageParams) {
- const { lng } = await params;
- const { t } = await useTranslation(lng, "demo");
-
- return (
- <>
- <div>{t("demoText")} 1</div>
- <DemoContent />
- <DemoIncome />
- <DemoTask />
- <DemoNotification />
- <DemoPublish />
- <DemoData />
- <DemoInteract />
- </>
- );
-}
diff --git a/src/app/[lng]/demo/uploadExample.tsx b/src/app/[lng]/demo/uploadExample.tsx
deleted file mode 100644
index 457394b7..00000000
--- a/src/app/[lng]/demo/uploadExample.tsx
+++ /dev/null
@@ -1,168 +0,0 @@
-"use client";
-
-import React, { useState } from "react";
-import { uploadToOss } from "@/api/oss";
-import { toolsApi } from "@/api/tools";
-
-export const UploadExample = () => {
- const [file, setFile] = useState<File | null>(null);
- const [uploading, setUploading] = useState(false);
- const [progress, setProgress] = useState(0);
- const [uploadType, setUploadType] = useState<'oss' | 'temp'>('oss');
- const [result, setResult] = useState<string>('');
-
- const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
- if (e.target.files && e.target.files[0]) {
- setFile(e.target.files[0]);
- setResult('');
- }
- };
-
- const handleUpload = async () => {
- if (!file) return;
-
- setUploading(true);
- setProgress(0);
- setResult('');
-
- try {
- let key: string;
-
- if (uploadType === 'oss') {
- // 使用 uploadToOss
- key = await uploadToOss(file, (prog) => {
- setProgress(prog);
- });
- } else {
- // 使用 uploadFileTemp
- key = await toolsApi.uploadFileTemp(file, (prog) => {
- setProgress(prog);
- });
- }
-
- setResult(`上传成功!文件Key: ${key}`);
- console.log('上传成功:', key);
- } catch (error) {
- console.error("上传失败:", error);
- setResult(`上传失败: ${error instanceof Error ? error.message : '未知错误'}`);
- } finally {
- setUploading(false);
- }
- };
-
- const formatFileSize = (bytes: number) => {
- if (bytes === 0) return '0 Bytes';
- const k = 1024;
- const sizes = ['Bytes', 'KB', 'MB', 'GB'];
- const i = Math.floor(Math.log(bytes) / Math.log(k));
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
- };
-
- return (
- <div className="p-6 max-w-2xl mx-auto">
- <h2 className="text-2xl font-bold mb-6">文件上传示例</h2>
-
- <div className="mb-6">
- <label className="block mb-2 text-sm font-medium text-gray-700">
- 选择上传类型
- </label>
- <div className="flex gap-4">
- <label className="flex items-center">
- <input
- type="radio"
- value="oss"
- checked={uploadType === 'oss'}
- onChange={(e) => setUploadType(e.target.value as 'oss')}
- className="mr-2"
- />
- OSS上传
- </label>
- <label className="flex items-center">
- <input
- type="radio"
- value="temp"
- checked={uploadType === 'temp'}
- onChange={(e) => setUploadType(e.target.value as 'temp')}
- className="mr-2"
- />
- 临时上传
- </label>
- </div>
- </div>
-
- <div className="mb-6">
- <label className="block mb-2 text-sm font-medium text-gray-700">
- 选择文件
- </label>
- <input
- type="file"
- onChange={handleFileChange}
- disabled={uploading}
- className="block w-full text-sm text-gray-500
- file:mr-4 file:py-2 file:px-4
- file:rounded file:border-0
- file:text-sm file:font-semibold
- file:bg-blue-50 file:text-blue-700
- hover:file:bg-blue-100"
- />
- </div>
-
- {file && (
- <div className="mb-6 p-4 bg-gray-50 rounded-lg">
- <h3 className="font-medium mb-2">文件信息:</h3>
- <p><span className="font-medium">文件名:</span> {file.name}</p>
- <p><span className="font-medium">文件大小:</span> {formatFileSize(file.size)}</p>
- <p><span className="font-medium">文件类型:</span> {file.type || "未知"}</p>
- <p className="mt-2 text-sm text-gray-600">
- {file.size > 10 * 1024 * 1024
- ? "⚠️ 文件大于10MB,将使用分片上传"
- : "✅ 文件小于10MB,将使用普通上传"}
- </p>
- </div>
- )}
-
- <button
- onClick={handleUpload}
- disabled={!file || uploading}
- className="px-6 py-2 bg-blue-600 text-white rounded-lg disabled:bg-gray-400 hover:bg-blue-700 transition-colors"
- >
- {uploading ? "上传中..." : "开始上传"}
- </button>
-
- {uploading && (
- <div className="mt-6">
- <div className="flex justify-between mb-1">
- <span className="text-sm font-medium">上传进度</span>
- <span className="text-sm font-medium">{progress}%</span>
- </div>
- <div className="w-full bg-gray-200 rounded-full h-2.5">
- <div
- className="bg-blue-600 h-2.5 rounded-full transition-all duration-300"
- style={{ width: `${progress}%` }}
- ></div>
- </div>
- </div>
- )}
-
- {result && (
- <div className={`mt-6 p-4 rounded-lg ${
- result.includes('成功')
- ? 'bg-green-50 text-green-800 border border-green-200'
- : 'bg-red-50 text-red-800 border border-red-200'
- }`}>
- <p className="font-medium">{result}</p>
- </div>
- )}
-
- <div className="mt-8 p-4 bg-blue-50 rounded-lg">
- <h3 className="font-medium mb-2 text-blue-800">功能说明:</h3>
- <ul className="text-sm text-blue-700 space-y-1">
- <li>• 文件小于10MB:使用普通上传</li>
- <li>• 文件大于10MB:自动使用分片上传(5MB/片)</li>
- <li>• 支持进度回调,实时显示上传进度</li>
- <li>• 支持OSS上传和临时上传两种方式</li>
- </ul>
- </div>
- </div>
- );
-};