From 8bead115f5e7588877b88d9b58a0364c28501fe0 Mon Sep 17 00:00:00 2001
From: "34701892@qq.com" <34701892@qq.com>
Date: Mon, 10 Nov 2025 10:13:15 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E7=B2=BE=E9=80=89=E9=A1=B5=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98=E5=B9=B6=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
添加formatTime函数处理时间戳格式,确保编辑精选页的时间显示正确
为搜索输入框添加回车和失焦事件触发搜索
更新开发环境API地址为正式环境
---
.env.development | 4 ++--
src/pages/realtimeInfo/pc/rank.vue | 18 ++++++++++++++++--
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/.env.development b/.env.development
index 9a5e003..db461ce 100644
--- a/.env.development
+++ b/.env.development
@@ -2,10 +2,10 @@
ENV = development
# 本地环境接口地址
-VITE_API_URL = http://123.60.153.169:8040/apih5
+# VITE_API_URL = http://123.60.153.169:8040/apih5
# VITE_API_URL = http://4155gf93ll13.vicp.fun/apih5
# VITE_API_URL = http://123.60.79.143:8041/apih5
# VITE_API_URL =http://localhost:8040/apih5
-# VITE_API_URL = https://cankao.cs.com.cn/apih5
+VITE_API_URL = https://cankao.cs.com.cn/apih5
VITE_API_DATAV_URL = https://cankao.cs.com.cn/zzck_datav
\ No newline at end of file
diff --git a/src/pages/realtimeInfo/pc/rank.vue b/src/pages/realtimeInfo/pc/rank.vue
index ba380bd..282e3a7 100644
--- a/src/pages/realtimeInfo/pc/rank.vue
+++ b/src/pages/realtimeInfo/pc/rank.vue
@@ -8,7 +8,7 @@
编辑精选
@@ -37,7 +37,8 @@
{{ item.source }}
{{
dayjs(item.publish_time).format("YYYY-MM-DD HH:MM:ss") }}
- {{ item.time }}
+ {{
+ formatTime(item.time) }}
{{ item.news_score }}
@@ -83,6 +84,19 @@ const router = useRouter();
const pageType = ref(route.query.type);
const newsList = ref([]);
+function formatTime(timestamp) {
+ const date = new Date(Number(timestamp).toString().length === 10 ? timestamp * 1000 : timestamp);
+ return [
+ date.getFullYear(),
+ (date.getMonth() + 1).toString().padStart(2, '0'),
+ date.getDate().toString().padStart(2, '0')
+ ].join('-') + ' ' + [
+ date.getHours().toString().padStart(2, '0'),
+ date.getMinutes().toString().padStart(2, '0'),
+ date.getSeconds().toString().padStart(2, '0')
+ ].join(':');
+}
+
async function getNewsList() {
if (pageType.value == 4) {
// 编辑精选