Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 726e226

Browse files
committed
update
1 parent 5097b7f commit 726e226

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

‎src/components/Header/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// ==================
66
import React, { useState, useCallback } from "react";
77
import { Link } from "react-router-dom";
8-
import { Layout, Tooltip, Menu,Dropdown } from "antd";
8+
import { Layout, Tooltip, Dropdown } from "antd";
99
import {
1010
MenuFoldOutlined,
1111
FullscreenOutlined,

‎src/components/Menu/index.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Link, useNavigate, useLocation } from "react-router-dom";
99
import { cloneDeep } from "lodash";
1010

1111
const { Sider } = Layout;
12-
const { SubMenu, Item } = MenuAntd;
1312

1413
// ==================
1514
// 自定义的东西
@@ -21,7 +20,8 @@ import Icon from "@/components/Icon";
2120
// ==================
2221
// 类型声明
2322
// ==================
24-
import { Menu } from "@/models/index.type";
23+
import type { Menu } from "@/models/index.type";
24+
import type { ItemType } from "antd/lib/menu/hooks/useItems";
2525

2626
interface Props {
2727
data: Menu[]; // 所有的菜单数据
@@ -107,7 +107,7 @@ export default function MenuCom(props: Props): JSX.Element {
107107
// ==================
108108

109109
/** 处理原始数据,将原始数据处理为层级关系 **/
110-
const treeDom: JSX.Element[] = useMemo(() => {
110+
const treeDom: ItemType[] = useMemo(() => {
111111
const d: Menu[] = cloneDeep(props.data);
112112
// 按照sort排序
113113
d.sort((a, b) => {

‎src/pages/ErrorPages/401.tsx‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22

33
import React from "react";
44
import { Button } from "antd";
5-
import Img from "@/assets/error.gif";
6-
import { History } from "history";
5+
import { useNavigate } from "react-router-dom";
76

87
import "./index.less";
8+
import Img from "@/assets/error.gif";
99

10-
interface Props {
11-
history: History;
12-
}
13-
14-
export default function NoPowerContainer(props: Props): JSX.Element {
10+
export default function NoPowerContainer(): JSX.Element {
11+
const navigate = useNavigate();
1512
const gotoHome = (): void => {
16-
props.history.replace("/");
13+
navigate("/",{replace: true});
1714
};
1815

1916
return (

‎src/pages/System/RoleAdmin/index.type.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ export type PowerTreeInfo = {
4040
export type SearchInfo = {
4141
title: string | undefined; // 用户名
4242
conditions: number | undefined; // 状态
43-
};
43+
};

‎src/router/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// ==================
44
// 第三方库
55
// ==================
6-
import React, { useEffect,useCallback } from "react";
6+
import React, { useEffect } from "react";
77
import { Routes, Route, Navigate } from "react-router-dom";
88
import { useSelector, useDispatch } from "react-redux";
99
import { message } from "antd";

‎src/util/tools.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const tools = {
135135
* 0 算有效值
136136
* @param {Object} obj 待处理的对象
137137
* **/
138-
clearNull<T>(obj: T): T {
138+
clearNull<T>(obj: T): T {
139139
const temp: any = { ...obj };
140140
for (const key in temp) {
141141
if (temp.hasOwnProperty(key)) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /