Skip to content

Commit

Permalink
新增主页跳转功能
Browse files Browse the repository at this point in the history
在"Settings"组件中,通过新增的`handleLogoClick`函数,实现了点击logo返回主页的功能。该功能基于`umi`的历史路由,通过`history.push('/')`实现页面跳转。
  • Loading branch information
www.zerocode.net.cn committed Sep 17, 2024
1 parent 10cb2bc commit 4e7ae9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/account/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Me} from "@icon-park/react";
import * as cache from "@/utils/cache";
import {menuHeaderDropdown} from "@/layouts/HomeLayout";
import {useSearchParams} from "@@/exports";
import { history } from 'umi';

const {Item} = Menu;

Expand Down Expand Up @@ -97,12 +98,17 @@ const Settings: React.FC = () => {
const licence = cache.getItem2object('licence');
console.log(154, licence, licence?.licensedTo, licence.licensedStartTime);

const handleLogoClick = () => {
history.push('/');
};

return (
<WaterMark content={[licence?.licensedTo?licence?.licensedTo:'ERD Online', 'V5.0.0']}>

<ProLayout
logo={"/logo.svg"}
title={"ERD Online"}
onMenuHeaderClick={handleLogoClick}
bgLayoutImgList={[
{
src: 'https://img.alicdn.com/imgextra/i2/O1CN01O4etvp1DvpFLKfuWq_!!6000000000279-2-tps-609-606.png',
Expand Down

0 comments on commit 4e7ae9a

Please sign in to comment.