@@ -47,7 +47,9 @@ export default function () {
4747 const [ user , setUser ] = useState < any > ( { } ) ;
4848 const [ loading , setLoading ] = useState < boolean > ( true ) ;
4949 const [ systemInfo , setSystemInfo ] = useState < TSystemInfo > ( ) ;
50- const [ siteTitle , setSiteTitle ] = useState ( config . siteName ) ;
50+ const [ siteTitle , setSiteTitle ] = useState (
51+ ( ) => localStorage . getItem ( 'qinglong_panel_title' ) ?. trim ( ) || intl . get ( '青龙' ) ,
52+ ) ;
5153 const [ collapsed , setCollapsed ] = useState ( false ) ;
5254 const [ initLoading , setInitLoading ] = useState < boolean > ( true ) ;
5355 const {
@@ -166,6 +168,15 @@ export default function () {
166168 reloadSystemConfig ( ) ;
167169 } , [ ] ) ;
168170
171+ useEffect ( ( ) => {
172+ if ( ! [ '/login' , '/initialization' , '/error' ] . includes ( location . pathname ) ) {
173+ return ;
174+ }
175+ const title =
176+ ( config . documentTitleMap as any ) [ location . pathname ] || intl . get ( '未找到' ) ;
177+ document . title = `${ title } - ${ siteTitle } ` ;
178+ } , [ location . pathname , siteTitle ] ) ;
179+
169180 useEffect ( ( ) => {
170181 if ( theme === 'vs-dark' ) {
171182 document . body . setAttribute ( 'data-dark' , 'true' ) ;
@@ -281,7 +292,7 @@ export default function () {
281292 < >
282293 < Image preview = { false } src = "https://qn.whyour.cn/logo.png" />
283294 < div className = "title" >
284- < span className = "title" > { siteTitle } </ span >
295+ < span className = "title" > { intl . get ( '青龙' ) } </ span >
285296 < span
286297 onClick = { ( e ) => {
287298 e . stopPropagation ( ) ;
0 commit comments