Quellcode durchsuchen

解决用户图标不显示的问题,使用主题相关图标显示用户图标

dengdx vor 1 Woche
Ursprung
Commit
d34d1d2a2b

+ 44 - 0
src/assets/Icons/base/module-security/theme-dark/1x/user-not-login.svg

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   width="24"
+   height="24"
+   viewBox="0 0 24 24"
+   version="1.1"
+   id="svg1"
+   sodipodi:docname="darkuser.svg"
+   inkscape:version="1.4.2 (f4327f4, 2025-05-13)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs1" />
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#ffffff"
+     bordercolor="#111111"
+     borderopacity="1"
+     inkscape:showpageshadow="0"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="1"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:zoom="33.958333"
+     inkscape:cx="12"
+     inkscape:cy="12"
+     inkscape:window-width="1920"
+     inkscape:window-height="1017"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg1" />
+  <circle
+     fill="none"
+     cx="12"
+     cy="7"
+     r="3"
+     id="circle1" />
+  <path
+     d="M12 2C9.243 2 7 4.243 7 7s2.243 5 5 5 5-2.243 5-5S14.757 2 12 2zM12 10c-1.654 0-3-1.346-3-3s1.346-3 3-3 3 1.346 3 3S13.654 10 12 10zM21 21v-1c0-3.859-3.141-7-7-7h-4c-3.86 0-7 3.141-7 7v1h2v-1c0-2.757 2.243-5 5-5h4c2.757 0 5 2.243 5 5v1H21z"
+     id="path1"
+     style="fill:#ff6600" />
+</svg>

+ 1 - 1
src/assets/Icons/base/module-security/theme-default/1x/user-not-login.svg

@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14" id="User-Remove-Subtract--Streamline-Core"><desc>User Remove Subtract Streamline Icon: https://streamlinehq.com</desc><g id="user-remove-subtract--actions-remove-close-geometric-human-person-minus-single-up-user"><path id="Vector" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" d="M5.04 6.02C6.3931 6.02 7.49 4.9231 7.49 3.57S6.3931 1.12 5.04 1.12S2.59 2.2169 2.59 3.57S3.6869 6.02 5.04 6.02Z" stroke-width="1"></path><path id="Vector_2" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" d="M6.51 12.88H0.63V12.3487C0.6378 11.6018 0.8348 10.8689 1.2026 10.2188C1.5704 9.5686 2.097 9.0222 2.7331 8.6307C3.3693 8.2392 4.0944 8.0154 4.8405 7.98C4.9071 7.9769 4.9736 7.9752 5.04 7.9751C5.1064 7.9752 5.1729 7.9769 5.2395 7.98C5.9856 8.0154 6.7107 8.2392 7.3469 8.6307C7.7127 8.8559 8.0423 9.1322 8.3263 9.45" stroke-width="1"></path><path id="Vector_3" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" d="M8.47 11.9H13.37" stroke-width="1"></path></g></svg>
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle fill="none" cx="12" cy="7" r="3"/><path d="M12 2C9.243 2 7 4.243 7 7s2.243 5 5 5 5-2.243 5-5S14.757 2 12 2zM12 10c-1.654 0-3-1.346-3-3s1.346-3 3-3 3 1.346 3 3S13.654 10 12 10zM21 21v-1c0-3.859-3.141-7-7-7h-4c-3.86 0-7 3.141-7 7v1h2v-1c0-2.757 2.243-5 5-5h4c2.757 0 5 2.243 5 5v1H21z"/></svg>

+ 5 - 3
src/layouts/BottomBar.tsx

@@ -9,8 +9,10 @@ import ExitModal from '@/components/ExitModal';
 import { showNotImplemented } from '@/utils/notificationHelper';
 import { FormattedMessage } from 'react-intl';
 import logo from '@/assets/imgs/bzylogo.png';
+import { useAppSelector } from '@/states/store';
 
 const BottomBar: React.FC = () => {
+    const { themeType, currentTheme } = useAppSelector((state) => state.theme);
     const login = useSelector((state: RootState) => isLoggedIn(state.userInfo));
     const username = useSelector((state: RootState) => state.userInfo.name);
     const avatarUrl = useSelector((state: RootState) => state.userInfo.avatar);
@@ -71,7 +73,7 @@ const BottomBar: React.FC = () => {
                                         module="module-security"
                                         name="user-not-login"
                                         userId="user-A"
-                                        theme="default"
+                                        theme={themeType}
                                         size="2x"
                                         state="normal"
                                     />
@@ -81,7 +83,7 @@ const BottomBar: React.FC = () => {
                                     module="module-common"
                                     name="user-not-login"
                                     userId="user-A"
-                                    theme="default"
+                                    theme={themeType}
                                     size="2x"
                                     state="normal"
                                 />
@@ -106,7 +108,7 @@ const BottomBar: React.FC = () => {
                                 module="module-common"
                                 name="btn_3DCam_AIView"
                                 userId="user-A"
-                                theme="default"
+                                theme={themeType}
                                 size="2x"
                                 state="normal"
                             />