添加更新日期.

This commit is contained in:
lijiahangmax
2025-06-06 16:18:48 +08:00
parent 1767079249
commit 3a586c47a3
2 changed files with 13 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ export interface AppInfoResponse {
*/ */
export interface AppReleaseResponse { export interface AppReleaseResponse {
tagName: string; tagName: string;
releaseTime: string;
body: string; body: string;
} }

View File

@@ -32,7 +32,11 @@
<b v-if="app.version && repo.tagName && ('v' + app.version) !== repo.tagName" <b v-if="app.version && repo.tagName && ('v' + app.version) !== repo.tagName"
class="span-green ml8">新版本已发布, 请及时升级版本</b> class="span-green ml8">新版本已发布, 请及时升级版本</b>
</a-descriptions-item> </a-descriptions-item>
<!-- 当前后端版本 --> <!-- 最近更新时间 -->
<a-descriptions-item label="最近更新时间">
<span>{{ repo.releaseTime }}</span>
</a-descriptions-item>
<!-- 最新更新日志 -->
<a-descriptions-item label="最新更新日志"> <a-descriptions-item label="最新更新日志">
<a-textarea v-model="repo.body" <a-textarea v-model="repo.body"
:auto-size="{ minRows: 3, maxRows: 16 }" :auto-size="{ minRows: 3, maxRows: 16 }"
@@ -51,22 +55,23 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { AppInfoResponse, AppReleaseResponse } from '@/api/system/setting'; import type { AppInfoResponse, AppReleaseResponse } from '@/api/system/setting';
import { onMounted, reactive } from 'vue'; import { onMounted, ref } from 'vue';
import { getAppLatestRelease, getSystemAppInfo } from '@/api/system/setting';
import { copy } from '@/hooks/copy'; import { copy } from '@/hooks/copy';
import useLoading from '@/hooks/loading'; import useLoading from '@/hooks/loading';
import { getAppLatestRelease, getSystemAppInfo } from '@/api/system/setting';
const { loading, setLoading } = useLoading(); const { loading, setLoading } = useLoading();
const webVersion = import.meta.env.VITE_APP_VERSION; const webVersion = import.meta.env.VITE_APP_VERSION;
const app = reactive<AppInfoResponse>({ const app = ref<AppInfoResponse>({
version: '', version: '',
uuid: '', uuid: '',
}); });
const repo = reactive<AppReleaseResponse>({ const repo = ref<AppReleaseResponse>({
tagName: '', tagName: '',
releaseTime: '',
body: '', body: '',
}); });
@@ -75,8 +80,7 @@
setLoading(true); setLoading(true);
try { try {
const { data } = await getSystemAppInfo(); const { data } = await getSystemAppInfo();
app.version = data.version; app.value = data;
app.uuid = data.uuid;
} catch (e) { } catch (e) {
} finally { } finally {
setLoading(false); setLoading(false);
@@ -87,8 +91,7 @@
onMounted(async () => { onMounted(async () => {
try { try {
const { data } = await getAppLatestRelease(); const { data } = await getAppLatestRelease();
repo.tagName = data.tagName; repo.value = data;
repo.body = data.body;
} catch (e) { } catch (e) {
} }
}); });