版本信息页面
This commit is contained in:
parent
cd220e46b4
commit
2af7d67b26
16
src/api/info.js
Normal file
16
src/api/info.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import axiosInstance from './axiosConfig'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取后端版本信息
|
||||||
|
* GET /info
|
||||||
|
* 基于 axiosInstance 的 baseURL:`http://zybdatasupport.online:8000`
|
||||||
|
* 返回后端提供的原始 JSON 数据
|
||||||
|
*/
|
||||||
|
export const getBackendInfo = async () => {
|
||||||
|
try {
|
||||||
|
const { data } = await axiosInstance.get('/info')
|
||||||
|
return data
|
||||||
|
} catch (error) {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,11 @@
|
|||||||
|
### 后端
|
||||||
|
## V.2025.07.30.1
|
||||||
|
|
||||||
|
1、修改服务器地址
|
||||||
|
|
||||||
|
### 前端
|
||||||
## v.1.0.0
|
## v.1.0.0
|
||||||
|
|
||||||
1、添加版本信息页面
|
1、添加版本信息页面
|
||||||
|
|
||||||
2、更换api
|
2、修改服务器地址
|
||||||
|
|||||||
@ -3,9 +3,19 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>版本信息</h1>
|
<h1>版本信息</h1>
|
||||||
<div class="header-subtitle">
|
<div class="header-subtitle">
|
||||||
<span>当前应用版本:{{ appVersion }}</span>
|
<span>当前前端应用版本:{{ appVersion }}</span>
|
||||||
|
<br />
|
||||||
|
<span>当前后端应用版本:V.{{ backendVersion }}</span>
|
||||||
|
<h3>联系邮箱</h3>
|
||||||
|
<ul>
|
||||||
|
<li v-for="(email, name) in contactEmails" :key="name">
|
||||||
|
{{ name }}: {{ email }}
|
||||||
|
</li>
|
||||||
|
<li>kuangisa: 1549184870@qq.com</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<h2>更新日志</h2>
|
||||||
<div class="md-content" v-html="mdHtml"></div>
|
<div class="md-content" v-html="mdHtml"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -14,19 +24,70 @@
|
|||||||
import pkg from '../../../package.json'
|
import pkg from '../../../package.json'
|
||||||
import { marked } from 'marked'
|
import { marked } from 'marked'
|
||||||
import versionMd from '@/assets/version.md?raw'
|
import versionMd from '@/assets/version.md?raw'
|
||||||
|
import { getBackendInfo } from '@/api/info'
|
||||||
|
import { ref, onMounted } from 'vue'
|
||||||
|
|
||||||
|
const backendVersion = ref('')
|
||||||
|
const contactEmails = ref({})
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
try {
|
||||||
|
const info = await getBackendInfo()
|
||||||
|
backendVersion.value = info.version || '未知'
|
||||||
|
if (info.contact && info.contact.email) {
|
||||||
|
try {
|
||||||
|
const emailString = info.contact.email.replace(/'/g, '"')
|
||||||
|
contactEmails.value = JSON.parse(emailString)
|
||||||
|
} catch (e) {
|
||||||
|
contactEmails.value = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (_) {
|
||||||
|
backendVersion.value = '获取失败'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const appVersion = pkg.version || '未知'
|
const appVersion = pkg.version || '未知'
|
||||||
const mdHtml = marked.parse(versionMd || '')
|
const mdHtml = marked.parse(versionMd || '')
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-header {
|
.page-header {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 24px;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-header h1 {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.header-subtitle {
|
.header-subtitle {
|
||||||
color: #666;
|
color: #666;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header-subtitle span {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-subtitle h3 {
|
||||||
|
margin-top: 16px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-subtitle ul {
|
||||||
|
padding-left: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-subtitle li {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.md-content {
|
.md-content {
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user