小调整

This commit is contained in:
Liu 宇阳
2024-10-28 12:44:25 +08:00
parent 95c58a2a98
commit e9ec7b64f6
4 changed files with 14 additions and 11 deletions

10
.env_pro Normal file
View File

@@ -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

2
.gitignore vendored
View File

@@ -23,4 +23,4 @@ dist-ssr
*.sln
*.sw?
.env
.env_dev

View File

@@ -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

View File

@@ -6,12 +6,8 @@ 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<Result | null>(null);
const [date, setDate] = useState(dayjs(new Date()).format("YYYY/MM/DD"));
const [stats, setStats] = useState({
pv: 0,
ip: 0,
@@ -19,6 +15,8 @@ export default () => {
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;