优化
This commit is contained in:
@@ -5,5 +5,6 @@ function normalizeUrl(url: string | undefined, fallback: string) {
|
||||
|
||||
export const appEnv = {
|
||||
appTitle: normalizeUrl(import.meta.env.VITE_APP_TITLE, '通用管理平台'),
|
||||
appLogo: normalizeUrl(import.meta.env.VITE_APP_LOGO, ''),
|
||||
apiBaseUrl: normalizeUrl(import.meta.env.VITE_API_BASE_URL, '/api')
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_APP_TITLE: string
|
||||
readonly VITE_APP_LOGO?: string
|
||||
readonly VITE_API_BASE_URL: string
|
||||
readonly VITE_API_PROXY_TARGET?: string
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
@expand="authStore.layoutCollapsed = false"
|
||||
>
|
||||
<div class="brand-mark">
|
||||
<span class="brand-dot"></span>
|
||||
<img v-if="appLogo" class="brand-logo" :src="appLogo" alt="" />
|
||||
<span v-else class="brand-dot"></span>
|
||||
<span class="brand-name" :title="appTitle">{{ appTitle }}</span>
|
||||
</div>
|
||||
<div class="menu-wrap">
|
||||
@@ -107,6 +108,7 @@ const route = useRoute()
|
||||
const router = useRouter()
|
||||
const authStore = useAuthStore()
|
||||
const appTitle = appEnv.appTitle
|
||||
const appLogo = appEnv.appLogo
|
||||
const isFullscreen = ref(false)
|
||||
const SIDER_WIDTH_KEY = 'platform.layout.siderWidth'
|
||||
const MIN_SIDER_WIDTH = 200
|
||||
@@ -309,6 +311,13 @@ async function handleLogout() {
|
||||
box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
|
||||
}
|
||||
|
||||
.brand-logo {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
flex: 0 0 auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.brand-name {
|
||||
color: #111827;
|
||||
font-size: 15px;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<n-card class="login-card">
|
||||
<template #header>
|
||||
<div class="text-center">
|
||||
<div class="text-2xl font-semibold text-slate-900">通用管理平台</div>
|
||||
<div class="text-2xl font-semibold text-slate-900">{{ appTitle }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -34,11 +34,13 @@ import type { FormInst, FormRules } from 'naive-ui'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { appEnv } from '@/config/env'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const message = useMessage()
|
||||
const authStore = useAuthStore()
|
||||
const appTitle = appEnv.appTitle
|
||||
|
||||
const loading = ref(false)
|
||||
const formRef = ref<FormInst | null>(null)
|
||||
|
||||
Reference in New Issue
Block a user