diff --git a/.env b/.env index 1fc99ee..ed55e4c 100644 --- a/.env +++ b/.env @@ -11,7 +11,7 @@ VITE_BAIDU_TONGJI_ACCESS_TOKEN= # 星火AI相关配置(可选) # 配置教程:https://docs.liuyuyang.net/docs/项目部署/API/星火大模型.html -VITE_AI_APIPassword= +VITE_AI_APIPASSWORD= VITE_AI_MODEL=lite # 高德地图Web API diff --git a/README.md b/README.md index 2dafa5b..9600966 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ VITE_BAIDU_TONGJI_ACCESS_TOKEN= VITE_BAIDU_TONGJI_REFRESH_TOKEN= # 星火AI相关配置 -VITE_AI_APIPassword= +VITE_AI_APIPASSWORD= VITE_AI_MODEL= ``` diff --git a/src/pages/Create/index.tsx b/src/pages/Create/index.tsx index c955972..2c2ba31 100644 --- a/src/pages/Create/index.tsx +++ b/src/pages/Create/index.tsx @@ -101,7 +101,7 @@ export default () => { method: "POST", headers: { "Content-Type": "application/json", - "Authorization": `Bearer ${import.meta.env.VITE_AI_APIPassword}` + "Authorization": `Bearer ${import.meta.env.VITE_AI_APIPASSWORD}` }, body: JSON.stringify({ model: import.meta.env.VITE_AI_MODEL, diff --git a/src/pages/Dashboard/components/Stats/components/NewOldVisitors/index.tsx b/src/pages/Dashboard/components/Stats/components/NewOldVisitors/index.tsx index f799708..8457ce0 100644 --- a/src/pages/Dashboard/components/Stats/components/NewOldVisitors/index.tsx +++ b/src/pages/Dashboard/components/Stats/components/NewOldVisitors/index.tsx @@ -67,7 +67,7 @@ export default () => { const siteId = import.meta.env.VITE_BAIDU_TONGJI_SITE_ID; const token = import.meta.env.VITE_BAIDU_TONGJI_ACCESS_TOKEN; - const response = await fetch(`/api/rest/2.0/tongji/report/getData?access_token=${token}&site_id=${siteId}&start_date=${date}&end_date=${date}&metrics=new_visitor_count%2Cnew_visitor_ratio&method=trend%2Ftime%2Fa&gran=day&area=`); + const response = await fetch(`/baidu/rest/2.0/tongji/report/getData?access_token=${token}&site_id=${siteId}&start_date=${date}&end_date=${date}&metrics=new_visitor_count%2Cnew_visitor_ratio&method=trend%2Ftime%2Fa&gran=day&area=`); const data = await response.json(); const { result } = data; @@ -88,8 +88,8 @@ export default () => { }, []) return ( - -
+
+
@@ -100,11 +100,7 @@ export default () => {
- +
@@ -129,7 +125,7 @@ export default () => {
-
-
+ + ); }; \ No newline at end of file diff --git a/src/pages/Dashboard/components/Stats/components/VisitorsStatisChat/index.tsx b/src/pages/Dashboard/components/Stats/components/VisitorsStatisChat/index.tsx index e07034b..badda10 100644 --- a/src/pages/Dashboard/components/Stats/components/VisitorsStatisChat/index.tsx +++ b/src/pages/Dashboard/components/Stats/components/VisitorsStatisChat/index.tsx @@ -153,7 +153,7 @@ export default () => { const siteId = import.meta.env.VITE_BAIDU_TONGJI_SITE_ID; const token = import.meta.env.VITE_BAIDU_TONGJI_ACCESS_TOKEN; - const response = await fetch(`/api/rest/2.0/tongji/report/getData?access_token=${token}&site_id=${siteId}&start_date=${startDate}&end_date=${endDate}&metrics=pv_count%2Cip_count&method=overview%2FgetTimeTrendRpt`); + const response = await fetch(`/baidu/rest/2.0/tongji/report/getData?access_token=${token}&site_id=${siteId}&start_date=${startDate}&end_date=${endDate}&metrics=pv_count%2Cip_count&method=overview%2FgetTimeTrendRpt`); const data = await response.json(); const { result } = data; setResult(result); diff --git a/src/pages/Web/index.tsx b/src/pages/Web/index.tsx index 705c413..e6f22cb 100644 --- a/src/pages/Web/index.tsx +++ b/src/pages/Web/index.tsx @@ -43,7 +43,6 @@ export default () => { return acc; }, {} as { [key: string]: Web[] }); - console.log("grouped:", grouped); setList(grouped); setListTemp(data); setLoading(false) @@ -55,8 +54,6 @@ export default () => { // 获取网站类型列表 const getWebTypeList = async () => { const { data } = await getWebTypeListAPI(); - console.log("typeList:", { data }); - setTypeList(data); }; diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 80300a7..170be8c 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -6,7 +6,7 @@ interface ImportMetaEnv { readonly VITE_BAIDU_TONGJI_SITE_ID: string; readonly VITE_BAIDU_TONGJI_ACCESS_TOKEN: string; - readonly VITE_AI_APIPassword: string; + readonly VITE_AI_APIPASSWORD: string; readonly VITE_AI_MODEL: string; readonly VITE_GAODE_WEB_API: string; diff --git a/vite.config.js b/vite.config.js index c990908..8e53d42 100644 --- a/vite.config.js +++ b/vite.config.js @@ -26,7 +26,7 @@ export default defineConfig({ '/baidu': { target: 'https://openapi.baidu.com/', changeOrigin: true, - rewrite: (path) => path.replace(/^\/api/, ''), + rewrite: (path) => path.replace(/^\/baidu/, ''), }, '/qiniu': { target: 'https://rsf.qiniuapi.com/',