Skip to content

Commit

Permalink
Merge pull request #146 from guanweiwang/main
Browse files Browse the repository at this point in the history
fix: logo path error
  • Loading branch information
phxa1 authored Aug 1, 2024
2 parents 1d4ca40 + 53f912e commit 6ea0dfa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import Search from './search';
const NAV_LINK = [
{
title: '行业百科',
href: '/v3/wiki',
href: '/wiki',
},
{
title: '技术博客',
href: '/v3/blog',
href: '/blog',
},
{
title: '在线工具',
Expand All @@ -21,7 +21,7 @@ const NAV_LINK = [
},
{
title: '漏洞情报',
href: '/v3/vuldb',
href: '/vuldb',
},
];

Expand Down Expand Up @@ -57,7 +57,7 @@ const Header = () => {
<Stack direction='row' alignItems='center'>
<Box
component='img'
src='/logo.svg'
src='/tools/logo.svg'
onClick={() => {
window.open('/', '_self');
}}
Expand Down Expand Up @@ -112,7 +112,7 @@ const Header = () => {
variant='contained'
sx={{ width: 102, boxShadow: 'none', borderRadius: 1 }}
onClick={() => {
window.open('/workbench', '_self');
window.open('/console/workbench', '_self');
}}
>
工作台
Expand Down
10 changes: 4 additions & 6 deletions src/components/Header/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
import SearchRoundedIcon from '@mui/icons-material/SearchRounded';
import ClearRoundedIcon from '@mui/icons-material/ClearRounded';
import { useLocalStorageState } from 'ahooks';
import { useRouter } from 'next/navigation';

const innerTheme = createTheme({
palette: {
Expand Down Expand Up @@ -137,7 +136,6 @@ SearchBase.displayName = 'SearchBase';
export const DialogSearch = (props: { open: boolean; onClose(): void }) => {
const { open, onClose } = props;
const [keywords, setKeywords] = useState('');
const router = useRouter();
const [recentSearch, setRecentSearch] = useLocalStorageState<string[]>(
'recent-search',
{
Expand All @@ -146,7 +144,7 @@ export const DialogSearch = (props: { open: boolean; onClose(): void }) => {
);

const onSearch = () => {
if (!keywords) {
if (!keywords.trim()) {
return;
}
onClose();
Expand All @@ -165,7 +163,7 @@ export const DialogSearch = (props: { open: boolean; onClose(): void }) => {
} else {
setRecentSearch([keywords]);
}
router.push(`/v3/s?keywords=${keywords}`);
window.open(`/s?keywords=${keywords}`, '_self');
};

return (
Expand Down Expand Up @@ -195,7 +193,7 @@ export const DialogSearch = (props: { open: boolean; onClose(): void }) => {
readOnly: false,
autoFocus: true,
onChange: (e) => {
setKeywords(e.target.value.trim());
setKeywords(e.target.value);
},
onKeyDown: (e) => {
if (e.key === 'Enter') {
Expand Down Expand Up @@ -249,7 +247,7 @@ export const DialogSearch = (props: { open: boolean; onClose(): void }) => {
}
onClick={() => {
onClose();
router.push(`/v3/s?keywords=${k}`);
window.open(`/s?keywords=${k}`, '_self');
}}
>
<ListItemButton sx={{ pl: 1 }}>
Expand Down
1 change: 0 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export default function App({
width: '1180px',
mx: 'auto',
height: '100%',
mt: isProduction ? '64px' : 0,
}}
>
<Header />
Expand Down

0 comments on commit 6ea0dfa

Please sign in to comment.