增加后端版本展示
This commit is contained in:
10
openhis-ui-vue3/src/api/system/info.js
Normal file
10
openhis-ui-vue3/src/api/system/info.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getSystemVersion(options = {}) {
|
||||
return request({
|
||||
url: '/system/version',
|
||||
method: 'get',
|
||||
...options
|
||||
})
|
||||
}
|
||||
|
||||
@@ -100,12 +100,16 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<div class="footer">
|
||||
© 2025 {{ currentTenantName || settings.systemName }}信息管理系统 | 版本 {{ loginVersion }}
|
||||
<!-- 公司版权信息(新增) -->
|
||||
<div class="company-copyright">
|
||||
技术支持:上海经创贺联信息技术有限公司
|
||||
</div>
|
||||
© 2025 {{ currentTenantName || settings.systemName }}信息管理系统
|
||||
| 前端版本 {{ formattedFrontendVersion }}
|
||||
<span v-if="backendVersion">
|
||||
| 后端版本 {{ formattedBackendVersion }}
|
||||
</span>
|
||||
<!-- 公司版权信息(新增) -->
|
||||
<div class="company-copyright">
|
||||
技术支持:上海经创贺联信息技术有限公司
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<!-- 底部 -->
|
||||
@@ -126,7 +130,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getCurrentInstance, onMounted, ref, watch, nextTick} from 'vue';
|
||||
import {computed, getCurrentInstance, onMounted, ref, watch, nextTick} from 'vue';
|
||||
import settings from '@/settings';
|
||||
import {getCodeImg, getUserBindTenantList, sign} from '@/api/login';
|
||||
import {invokeYbPlugin5001} from '@/api/public';
|
||||
@@ -134,6 +138,7 @@ import Cookies from 'js-cookie';
|
||||
import {decrypt, encrypt} from '@/utils/jsencrypt';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import {ElMessage} from 'element-plus';
|
||||
import {getSystemVersion} from '@/api/system/info';
|
||||
import logoNew from '@/assets/logo/LOGO.jpg';
|
||||
|
||||
const userStore = useUserStore();
|
||||
@@ -142,6 +147,30 @@ const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const env = import.meta.env.MODE;
|
||||
const loginVersion = import.meta.env.VITE_APP_BUILD_VERSION;
|
||||
const backendVersion = ref('');
|
||||
|
||||
const formattedFrontendVersion = computed(() => {
|
||||
if (!loginVersion) return '';
|
||||
// 期望格式:YYYYMMDDHHmmss -> 显示 YYYY-MM-DD
|
||||
if (loginVersion.length >= 8) {
|
||||
const y = loginVersion.substring(0, 4);
|
||||
const m = loginVersion.substring(4, 6);
|
||||
const d = loginVersion.substring(6, 8);
|
||||
return `${y}-${m}-${d}`;
|
||||
}
|
||||
return loginVersion;
|
||||
});
|
||||
|
||||
const formattedBackendVersion = computed(() => {
|
||||
if (!backendVersion.value) return '';
|
||||
if (backendVersion.value.length >= 8) {
|
||||
const y = backendVersion.value.substring(0, 4);
|
||||
const m = backendVersion.value.substring(4, 6);
|
||||
const d = backendVersion.value.substring(6, 8);
|
||||
return `${y}-${m}-${d}`;
|
||||
}
|
||||
return backendVersion.value;
|
||||
});
|
||||
|
||||
const loginForm = ref({
|
||||
username: '',
|
||||
@@ -237,6 +266,15 @@ onMounted(() => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取后端版本号
|
||||
getSystemVersion().then((res) => {
|
||||
if (res && res.data && res.data.backendVersion) {
|
||||
backendVersion.value = res.data.backendVersion;
|
||||
}
|
||||
}).catch(() => {
|
||||
backendVersion.value = '';
|
||||
});
|
||||
});
|
||||
|
||||
function handleLogin() {
|
||||
|
||||
Reference in New Issue
Block a user