温华:暂时修复打包失败问题
This commit is contained in:
@@ -5,7 +5,7 @@ import ParentView from './ParentView'
|
||||
import Loading from './Loading'
|
||||
import currentRouter from './router'
|
||||
import RouteInterception from './router/RouteInterception'
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { Suspense, lazy, useEffect, useState } from 'react'
|
||||
const Views = import.meta.glob('./view/**/*.tsx')
|
||||
const transferReactNode = (comp: string) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import NProgress from './mynprogress'
|
||||
import { Spin } from "antd";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Form, Input, Image, message } from "antd";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import './assets/styles/login.scss'
|
||||
import { getCaptchaApi, loginApi } from "./api/login";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
|
||||
|
||||
export default function Notfound() {
|
||||
return <div>404</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
|
||||
import { Outlet } from 'react-router-dom'
|
||||
|
||||
export default function ParentView() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
/**
|
||||
* @author {温华}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
// import React from "react";
|
||||
|
||||
export default function ConfirmModel() {
|
||||
// export default function ConfirmModel() {
|
||||
|
||||
}
|
||||
// }
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from "react";
|
||||
// import { useState, useEffect } from "react";
|
||||
|
||||
export default function useDemo() {
|
||||
// export default function useDemo() {
|
||||
|
||||
}
|
||||
// }
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from "react";
|
||||
import '../../assets/styles/appmain.scss'
|
||||
import { Outlet } from "react-router-dom";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { Layout } from 'antd'
|
||||
import { useSelector } from 'react-redux'
|
||||
import SideBar from "./sidebar";
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
MenuFoldOutlined,
|
||||
MenuUnfoldOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import React from 'react'
|
||||
|
||||
import { useSelector, useDispatch } from 'react-redux'
|
||||
import { setCollapsed } from '../../stores/sidebar';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Menu } from 'antd'
|
||||
import React, {Fragment, useEffect, useState} from 'react'
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import {Fragment, useEffect, useState} from 'react'
|
||||
import { useSelector } from 'react-redux';
|
||||
import { generateMenu } from '../../permission';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function SideBar() {
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const routes: [] = useSelector((store: any)=>store.permission)
|
||||
const dispatch = useDispatch()
|
||||
// const dispatch = useDispatch()
|
||||
const [menuItem, setMenuItem] = useState<Array<any>>([{
|
||||
key: '/',
|
||||
label: '首页',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Navigate } from "react-router-dom"
|
||||
import Notfound from "../Notfound"
|
||||
import { getToken } from "../utils/auth"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import { addRoutes, getAsyncRouters } from "../stores/permission"
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { getToken } from '../utils/auth'
|
||||
import LayOut from '../layout/index'
|
||||
import { Suspense, lazy } from 'react'
|
||||
import Loading from '../Loading'
|
||||
import RouteInterception from './RouteInterception'
|
||||
import Notfound from '../Notfound'
|
||||
interface Meta {
|
||||
title: string,
|
||||
redirect?: boolean
|
||||
}
|
||||
// interface Meta {
|
||||
// title: string,
|
||||
// redirect?: boolean
|
||||
// }
|
||||
|
||||
type route = {
|
||||
path: string,
|
||||
|
||||
@@ -34,12 +34,16 @@ export const authInfoSlice = createSlice({
|
||||
extraReducers(builder) {
|
||||
builder
|
||||
.addCase(getAuthInfo.pending, (state) => {
|
||||
console.log(state);
|
||||
|
||||
console.log('正在请求登录用户信息')
|
||||
})
|
||||
.addCase(getAuthInfo.fulfilled, (state, {payload}) => {
|
||||
console.log(state);
|
||||
return payload
|
||||
})
|
||||
.addCase(getAuthInfo.rejected, (state, err) => {
|
||||
console.log(state);
|
||||
console.log(err, 'rejected')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
type CacheKey = string
|
||||
// type CacheKey = string
|
||||
|
||||
type CacheVal = any
|
||||
// type CacheVal = any
|
||||
|
||||
const initCache = new Map<CacheKey, CacheVal>([])
|
||||
// const initCache = new Map<CacheKey, CacheVal>([])
|
||||
|
||||
// 创建一个slice
|
||||
export const cacheSlice = createSlice({
|
||||
|
||||
@@ -46,13 +46,16 @@ export const permissionSlice = createSlice({
|
||||
extraReducers(builder) {
|
||||
builder
|
||||
.addCase(getAsyncRouters.pending, (state) => {
|
||||
console.log(state);
|
||||
console.log('正在请求路由');
|
||||
})
|
||||
.addCase(getAsyncRouters.fulfilled, (state, { payload }) => {
|
||||
console.log(state);
|
||||
// 请求成功后处理路由
|
||||
return payload
|
||||
})
|
||||
.addCase(getAsyncRouters.rejected, (state, err) => {
|
||||
console.log(state);
|
||||
console.log(err,'rejected');
|
||||
|
||||
})
|
||||
|
||||
@@ -6,13 +6,13 @@ export interface IResponse<T=any> {
|
||||
}
|
||||
|
||||
// 定义请求方式枚举
|
||||
enum EMethod {
|
||||
GET = 'get',
|
||||
POST = 'post',
|
||||
PUT = 'put',
|
||||
DELETE = 'delete',
|
||||
PATCH = 'patch'
|
||||
}
|
||||
// enum EMethod {
|
||||
// GET = 'get',
|
||||
// POST = 'post',
|
||||
// PUT = 'put',
|
||||
// DELETE = 'delete',
|
||||
// PATCH = 'patch'
|
||||
// }
|
||||
|
||||
// 用户token类型定义
|
||||
export type IToken = string
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { IResponse, IToken } from "@/type";
|
||||
import axios, { InternalAxiosRequestConfig, AxiosInstance, AxiosRequestConfig } from "axios";
|
||||
import Cookie from 'js-cookie'
|
||||
import { getToken, removeToken } from "./auth";
|
||||
import { message } from "antd";
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import React from 'react'
|
||||
|
||||
export default function Home() {
|
||||
return(
|
||||
<div>home</div>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import React from "react";
|
||||
|
||||
export default function Dept() {
|
||||
return(
|
||||
<div>dept</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from 'react'
|
||||
|
||||
|
||||
export default function User() {
|
||||
return(
|
||||
|
||||
Reference in New Issue
Block a user