fix 修复时区显示问题以及知识库描述显示不全的问题
This commit is contained in:
parent
b81f31c652
commit
645acff37c
@ -555,10 +555,14 @@ const openFileDetail = (record) => {
|
||||
state.lock = false
|
||||
}
|
||||
}
|
||||
|
||||
const formatRelativeTime = (timestamp) => {
|
||||
// 调整为东八区时间(UTC+8)
|
||||
const timezoneOffset = 8 * 60 * 60 * 1000; // 东八区偏移量(毫秒)
|
||||
const adjustedTimestamp = timestamp + timezoneOffset;
|
||||
|
||||
const now = Date.now();
|
||||
const secondsPast = (now - timestamp) / 1000;
|
||||
const secondsPast = (now - adjustedTimestamp) / 1000;
|
||||
|
||||
if (secondsPast < 60) {
|
||||
return Math.round(secondsPast) + ' 秒前';
|
||||
} else if (secondsPast < 3600) {
|
||||
@ -566,7 +570,7 @@ const formatRelativeTime = (timestamp) => {
|
||||
} else if (secondsPast < 86400) {
|
||||
return Math.round(secondsPast / 3600) + ' 小时前';
|
||||
} else {
|
||||
const date = new Date(timestamp);
|
||||
const date = new Date(adjustedTimestamp);
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
|
||||
@ -46,7 +46,9 @@
|
||||
<p><span>{{ database.files ? Object.keys(database.files).length : 0 }} 文件</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="description">{{ database.description || '暂无描述' }}</p>
|
||||
<a-tooltip :title="database.description || '暂无描述'">
|
||||
<p class="description">{{ database.description || '暂无描述' }}</p>
|
||||
</a-tooltip>
|
||||
<div class="tags">
|
||||
<a-tag color="blue" v-if="database.embed_model">{{ database.embed_model }}</a-tag>
|
||||
<a-tag color="green" v-if="database.dimension">{{ database.dimension }}</a-tag>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user