File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const baseConfig = {
6868 */
6969 // 第二项(入口文件):https://webpack.docschina.org/concepts/#%E5%85%A5%E5%8F%A3entry
7070 entry : {
71- app : [ 'react-hot-loader/patch' , resolvePath ( 'src/index .tsx' ) ] ,
71+ app : [ 'react-hot-loader/patch' , resolvePath ( 'src/main .tsx' ) ] ,
7272 } ,
7373 /*
7474 https://webpack.docschina.org/concepts/#%E8%BE%93%E5%87%BAoutput
File renamed without changes.
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { useHistory } from 'react-router-dom';
55import Footer from '@/components/footer' ;
66import { HostName } from '../../api/config' ;
77import * as AuthAction from '../../api/request/auth' ;
8- import { LoginResponse } from '../../api/response/auth' ;
98import { titleMap } from '../../utils' ;
109import './login.less' ;
1110
@@ -16,14 +15,15 @@ export default function Page() {
1615 setLoginFlag ( true ) ;
1716 const { username = 'admin' , password = '123456' } = values ;
1817 try {
19- const data : LoginResponse = await AuthAction . login ( {
18+ const resp : any = await AuthAction . login ( {
2019 username,
2120 password,
2221 } ) ;
23- console . log ( 'data=======:' , data ) ;
22+ const { success, data } = resp ;
23+ if ( ! success ) return ;
2424 sessionStorage . setItem ( 'token' , data ?. token ) ;
2525 setLoginFlag ( false ) ;
26- history . push ( '/main' ) ;
26+ history . push ( '/main' , { replace : true } ) ;
2727 } catch ( error ) {
2828 setLoginFlag ( false ) ;
2929 console . log ( error ) ;
Original file line number Diff line number Diff line change 11import { DatePicker } from 'antd' ;
2- import { DateFormat } from '../typings/constant' ;
3- import { dateFormatYMD } from '../utils' ;
4- import '../styles /main.less' ;
2+ import { DateFormat } from '../../ typings/constant' ;
3+ import { dateFormatYMD } from '../../ utils' ;
4+ import './main.less' ;
55
66const { RangePicker } = DatePicker ;
77export default function Main ( ) {
File renamed without changes.
Original file line number Diff line number Diff line change 1+ import loadable from './utils/loadable' ;
2+ import AdminRouter from './pages/admin/router' ;
3+ import AuthRouter from './pages/auth/router' ;
4+
5+ const Main = loadable ( ( ) => import ( './pages/main' ) ) ;
6+
7+ const routes = [
8+ {
9+ path : '/main' ,
10+ name : 'Dashboard' ,
11+ exact : true ,
12+ component : Main ,
13+ auth : [ 1 ] ,
14+ } ,
15+ ...AdminRouter ,
16+ ...AuthRouter ,
17+ ] ;
18+
19+ export default routes ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments