We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5097b7f commit 726e226Copy full SHA for 726e226
src/components/Header/index.tsx
@@ -5,7 +5,7 @@
5
// ==================
6
import React, { useState, useCallback } from "react";
7
import { Link } from "react-router-dom";
8
-import { Layout, Tooltip, Menu,Dropdown } from "antd";
+import { Layout, Tooltip, Dropdown } from "antd";
9
import {
10
MenuFoldOutlined,
11
FullscreenOutlined,
src/components/Menu/index.tsx
@@ -9,7 +9,6 @@ import { Link, useNavigate, useLocation } from "react-router-dom";
import { cloneDeep } from "lodash";
const { Sider } = Layout;
12
-const { SubMenu, Item } = MenuAntd;
13
14
15
// 自定义的东西
@@ -21,7 +20,8 @@ import Icon from "@/components/Icon";
21
20
22
// 类型声明
23
24
-import { Menu } from "@/models/index.type";
+import type { Menu } from "@/models/index.type";
+import type { ItemType } from "antd/lib/menu/hooks/useItems";
25
26
interface Props {
27
data: Menu[]; // 所有的菜单数据
@@ -107,7 +107,7 @@ export default function MenuCom(props: Props): JSX.Element {
107
108
109
/** 处理原始数据,将原始数据处理为层级关系 **/
110
- const treeDom: JSX.Element[] = useMemo(() => {
+ const treeDom: ItemType[] = useMemo(() => {
111
const d: Menu[] = cloneDeep(props.data);
112
// 按照sort排序
113
d.sort((a, b) => {
src/pages/ErrorPages/401.tsx
@@ -2,18 +2,15 @@
2
3
import React from "react";
4
import { Button } from "antd";
-import Img from "@/assets/error.gif";
-import { History } from "history";
+import { useNavigate } from "react-router-dom";
import "./index.less";
+import Img from "@/assets/error.gif";
-interface Props {
- history: History;
-}
-
-export default function NoPowerContainer(props: Props): JSX.Element {
+export default function NoPowerContainer(): JSX.Element {
+ const navigate = useNavigate();
const gotoHome = (): void => {
16
- props.history.replace("/");
+ navigate("/",{replace: true});
17
};
18
19
return (
src/pages/System/RoleAdmin/index.type.ts
@@ -40,4 +40,4 @@ export type PowerTreeInfo = {
40
export type SearchInfo = {
41
title: string | undefined; // 用户名
42
conditions: number | undefined; // 状态
43
-};
+};
src/router/index.tsx
@@ -3,7 +3,7 @@
// 第三方库
-import React, { useEffect,useCallback } from "react";
+import React, { useEffect } from "react";
import { Routes, Route, Navigate } from "react-router-dom";
import { useSelector, useDispatch } from "react-redux";
import { message } from "antd";
src/util/tools.ts
@@ -135,7 +135,7 @@ const tools = {
135
* 0 算有效值
136
* @param {Object} obj 待处理的对象
137
* **/
138
- clearNull<T>(obj: T): T {
+ clearNull<T>(obj: T): T {
139
const temp: any = { ...obj };
140
for (const key in temp) {
141
if (temp.hasOwnProperty(key)) {
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments