diff --git a/.env_pro b/.env_pro new file mode 100644 index 0000000..6400388 --- /dev/null +++ b/.env_pro @@ -0,0 +1,10 @@ +# 百度统计相关配置 +VITE_BAIDU_TONGJI_KEY= +VITE_BAIDU_TONGJI_SECRET_KEY= +VITE_BAIDU_TONGJI_SITE_ID= +VITE_BAIDU_TONGJI_ACCESS_TOKEN= +VITE_BAIDU_TONGJI_REFRESH_TOKEN= + +# 星火AI相关配置 +VITE_AI_APIPassword= +VITE_AI_MODEL=general \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3b0b403..2e08f16 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,4 @@ dist-ssr *.sln *.sw? -.env \ No newline at end of file +.env_dev \ No newline at end of file diff --git a/dockerfile b/dockerfile index 11b97b8..61f1f6a 100644 --- a/dockerfile +++ b/dockerfile @@ -25,9 +25,6 @@ FROM nginx:alpine # 复制构建输出到 Nginx 的默认静态文件目录 COPY --from=builder /app/dist /usr/share/nginx/html -# 复制自定义的 Nginx 配置文件(如果需要) -# COPY nginx.conf /etc/nginx/nginx.conf - # 暴露端口 EXPOSE 9002 diff --git a/src/pages/Stats/index.tsx b/src/pages/Stats/index.tsx index 7ec7cc3..b16b0d6 100644 --- a/src/pages/Stats/index.tsx +++ b/src/pages/Stats/index.tsx @@ -6,19 +6,17 @@ import CardDataStats from "@/components/CardDataStats" import { AiOutlineEye, AiOutlineMeh, AiOutlineStock, AiOutlineFieldTime } from "react-icons/ai"; import { useEffect, useState } from "react" import dayjs from 'dayjs'; -import { Result } from "./type" - export default () => { - const [result, setResult] = useState(null); - const [date, setDate] = useState(dayjs(new Date()).format("YYYY/MM/DD")); const [stats, setStats] = useState({ pv: 0, ip: 0, bounce: 0, avgTime: "", }); - + + const date = dayjs(new Date()).format("YYYY/MM/DD"); + const formatTime = (seconds: number) => { // 四舍五入到最接近的整数 const roundedSeconds = Math.round(seconds); @@ -38,8 +36,6 @@ export default () => { const data = await response.json(); const { result } = data; - setResult(result); - let pv = 0; let ip = 0; let bounce = 0;