fix: hide sidebar user actions and add navTheme config

This commit is contained in:
Your Name 2026-03-30 16:00:31 +08:00
parent 5141e9c72b
commit 0cdf53523e
5 changed files with 28 additions and 9 deletions

View File

@ -14,7 +14,7 @@ export default defineConfig({
}, },
proxy: { proxy: {
'/api/': { '/api/': {
target: 'http://10.39.13.78:8001/', target: 'http://10.39.13.78:8002/',
// target: 'https://test-admin.linyikj.com.cn/', // target: 'https://test-admin.linyikj.com.cn/',
// target: 'https://admin.linyikj.com.cn/', // target: 'https://admin.linyikj.com.cn/',
changeOrigin: true, changeOrigin: true,

View File

@ -39,24 +39,27 @@ export const LayoutConfig: RuntimeConfig['layout'] = () => {
colorPrimary: '#1890ff', colorPrimary: '#1890ff',
siderWidth: 220, siderWidth: 220,
pure: history.location.pathname === '/login', pure: history.location.pathname === '/login',
// 禁用顶部导航栏的菜单
navTheme: 'light',
// 新增自定义Header渲染 // 自定义Header渲染
headerRender: () => { // 注意在side模式下headerRender可能需要特殊处理
return <CustomHeader />; // headerRender: false, // 完全禁用header
},
// 新增自定义Logo渲染 // 新增自定义Logo渲染
logoRenderer: (collapsed: boolean) => { logoRenderer: (collapsed: boolean) => {
return <CustomLogo collapsed={collapsed} />; return <CustomLogo collapsed={collapsed} />;
}, },
// 移除avatarProps以避免在侧边栏底部重复显示用户信息 // 完全禁用用户信息在侧边栏底部显示
// 用户信息已在CustomHeader中显示 // avatarProps: false, // 这样可以完全禁用
//水印设置 //水印设置
// waterMarkProps: { // waterMarkProps: {
// content: snap.session.user?.username, // content: snap.session.user?.username,
// }, // },
collapsedButtonRender: false, collapsedButtonRender: false,
// 禁用底部的版权信息等
footerRender: false,
token: { token: {
bgLayout: '#f5f5f5', // 浅灰布局背景 bgLayout: '#f5f5f5', // 浅灰布局背景
header: { header: {

View File

@ -12,6 +12,7 @@ import {
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { stateActions } from '..'; import { stateActions } from '..';
import loginBgImg from './loginBgImg.jpg';
export function MyLoginPage1() { export function MyLoginPage1() {
const navigate = useNavigate(); const navigate = useNavigate();
@ -37,8 +38,9 @@ export function MyLoginPage1() {
> >
<LoginFormPage<ApiTypes.Common.Auth.Login> <LoginFormPage<ApiTypes.Common.Auth.Login>
title="欢迎使用后台管理系统" title="欢迎使用后台管理系统"
backgroundVideoUrl="https://gw.alipayobjects.com/v/huamei_gcee1x/afts/video/jXRBRK_VAwoAAAAAAAAAAAAAK4eUAQBr" // backgroundVideoUrl="https://gw.alipayobjects.com/v/huamei_gcee1x/afts/video/jXRBRK_VAwoAAAAAAAAAAAAAK4eUAQBr"
subTitle="Admin management system" backgroundImageUrl={loginBgImg}
subTitle="物业管理平台管理后台"
onFinish={async (values: any) => { onFinish={async (values: any) => {
Apis.Common.Auth.Login({ Apis.Common.Auth.Login({
...values, ...values,

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@ -98,3 +98,17 @@ body {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03); box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
padding: 24px; padding: 24px;
} }
// 隐藏侧边栏底部的用户信息区域
.ant-pro-sider .ant-pro-sider-actions {
display: none !important;
}
.ant-pro-sider-collapsed .ant-pro-sider-actions {
display: none !important;
}
// 确保顶部Header显示
.ant-pro-header {
display: flex !important;
}