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