Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logo path error #146

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading