feat(前端): 供应商系统更换品牌图标(用户指定图一)
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

开发者提供新 logo 图(圆形渐变立体方块)要求替换系统图标。处理:
- 原图裁成圆形、去白底,输出 512×512 透明 PNG 入库 src/assets/brand-logo.png;
- 新增 BrandLogo 组件(侧边栏 38px / 登录页 64px 共用),替换原绿色渐变方块 + Package 图标;
- index.html favicon 改为内联 PNG dataURI(顺带修掉 public/favicon 不会被打进生产 dist 的既有隐患);
- 品牌文案(生鲜配送管理系统/副标题)未动;旧 public/favicon.svg|ico 不再引用但未删。

验证:typecheck 通过;webpack dev 编译成功;无头浏览器实测登录页新图标渲染成功
(naturalWidth=512)、无 JS 错误;前端单测 229 通过/4 既有红(menuCatalog、
QuoteVersionManagement.cardLayout、BidInvitations、CustomerOrder,与本次无关)。未部署。
This commit is contained in:
Ubuntu
2026-10-22 09:40:48 +08:00
parent 44aead2acc
commit f155d839f1
7 changed files with 32 additions and 8 deletions
+2
View File
@@ -208,6 +208,8 @@ server-go/server-go
.go/ .go/
*.tar.gz *.tar.gz
*.png *.png
# 应用内品牌/UI 图标属源码资源,需入库(2026-10-22 供应商系统换标)
!src/assets/brand-logo.png
.log-analysis.txt .log-analysis.txt
.tablet-full-logcat.txt .tablet-full-logcat.txt
.tablet-full-logcat-utf8.txt .tablet-full-logcat-utf8.txt
+2 -2
View File
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

+13
View File
@@ -0,0 +1,13 @@
import React from 'react';
import brandLogo from '../assets/brand-logo.png';
/**
* 供应商系统品牌图标(2026-10-21 用户指定:换成「图一 · 圆形立体方块」)。
*
* 只换图标,**品牌文案不动**;图片由 webpack asset 模块内联(<1MB 转 dataURL),
* 因此 dev / 生产构建都不依赖 `public/` 静态文件。`alt=""` + `aria-hidden`:
* 图标属装饰,旁边已有品牌名,读屏不重复播报。
*/
export const BrandLogo: React.FC<{ className?: string }> = ({
className = 'w-full h-full object-contain',
}) => <img src={brandLogo} alt="" aria-hidden="true" draggable={false} className={className} />;
+3 -3
View File
@@ -2,10 +2,10 @@ import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react'
import { Outlet, NavLink, useLocation } from 'react-router-dom'; import { Outlet, NavLink, useLocation } from 'react-router-dom';
import { import {
PanelLeftOpen, PanelLeftOpen,
Package,
ChevronRight, ChevronRight,
Menu, Menu,
} from 'lucide-react'; } from 'lucide-react';
import { BrandLogo } from './BrandLogo';
import { useAuth } from '../hooks/useAuth'; import { useAuth } from '../hooks/useAuth';
import { useOperatingBranch } from '../hooks/useOperatingBranch'; import { useOperatingBranch } from '../hooks/useOperatingBranch';
import { useMenuLayout } from '../hooks/useMenuLayout'; import { useMenuLayout } from '../hooks/useMenuLayout';
@@ -235,8 +235,8 @@ export const Layout: React.FC = () => {
> >
{/* Logo Area */} {/* Logo Area */}
<div className="h-16 flex items-center gap-3 px-5 border-b shrink-0" style={{ borderColor: 'var(--app-sidebar-border)' }}> <div className="h-16 flex items-center gap-3 px-5 border-b shrink-0" style={{ borderColor: 'var(--app-sidebar-border)' }}>
<div className="app-logo w-[38px] h-[38px] flex items-center justify-center shrink-0"> <div className="w-[38px] h-[38px] flex items-center justify-center shrink-0">
<Package className="w-[22px] h-[22px] text-white" /> <BrandLogo />
</div> </div>
<div className="sidebar-hide-collapsed overflow-hidden whitespace-nowrap transition-all duration-250"> <div className="sidebar-hide-collapsed overflow-hidden whitespace-nowrap transition-all duration-250">
<span className="app-foreground block text-[15px] font-semibold leading-tight tracking-tight"> <span className="app-foreground block text-[15px] font-semibold leading-tight tracking-tight">
+4 -3
View File
@@ -1,6 +1,7 @@
import React, { useMemo, useState } from 'react'; import React, { useMemo, useState } from 'react';
import { useNavigate, useSearchParams, useLocation } from 'react-router-dom'; import { useNavigate, useSearchParams, useLocation } from 'react-router-dom';
import { ChevronDown, Eye, EyeOff, Loader2, Package, X } from 'lucide-react'; import { ChevronDown, Eye, EyeOff, Loader2, X } from 'lucide-react';
import { BrandLogo } from '../../components/BrandLogo';
import { useAuth } from '../../hooks/useAuth'; import { useAuth } from '../../hooks/useAuth';
import { import {
loadRecentLoginUsernames, loadRecentLoginUsernames,
@@ -152,8 +153,8 @@ export const Login: React.FC = () => {
<div className="relative z-[1] w-full max-w-md"> <div className="relative z-[1] w-full max-w-md">
{/* Logo */} {/* Logo */}
<div className="text-center mb-8"> <div className="text-center mb-8">
<div className="app-logo inline-flex items-center justify-center w-16 h-16 mb-4"> <div className="inline-flex items-center justify-center w-16 h-16 mb-4">
<Package className="w-8 h-8 text-white" /> <BrandLogo />
</div> </div>
<h1 className="text-2xl font-semibold tracking-tight text-gray-900 dark:text-white mb-2"> <h1 className="text-2xl font-semibold tracking-tight text-gray-900 dark:text-white mb-2">
{t('login.brandTitle')} {t('login.brandTitle')}
+8
View File
@@ -0,0 +1,8 @@
/**
* Webpack 把图片当 asset 模块处理(`<1MB` 内联为 dataURL,见 webpack.config.js)。
* TS 侧补模块声明,避免 `import logo from '../assets/xxx.png'` 报「找不到模块」。
*/
declare module '*.png' {
const src: string;
export default src;
}