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