Skip to content

Commit e9b7871

Browse files
committed
'优化登录逻辑,修复部分定义错误,更新依赖至最新'
1 parent 1177b03 commit e9b7871

15 files changed

+256
-132
lines changed

.babelrc.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@ module.exports = {
6060
useESModules: true,
6161
},
6262
],
63-
[
64-
"import",
65-
// using antd UI
66-
{
67-
libraryName: "antd",
68-
libraryDirectory: "es",
69-
// style: 'css', // `style: true` 会加载 less 文件
70-
style: true,
71-
},
72-
// // using material-ui
73-
// {
74-
// "libraryName": "@material-ui/core",
75-
// "libraryDirectory": "components", // default: lib
76-
// "camel2DashComponentName": false // default: true
77-
// }
78-
],
63+
// [
64+
// "import",
65+
// // using antd UI
66+
// {
67+
// libraryName: "antd",
68+
// libraryDirectory: "es",
69+
// // style: 'css', // `style: true` 会加载 less 文件
70+
// style: true,
71+
// },
72+
// // // using material-ui
73+
// // {
74+
// // "libraryName": "@material-ui/core",
75+
// // "libraryDirectory": "components", // default: lib
76+
// // "camel2DashComponentName": false // default: true
77+
// // }
78+
// ],
7979
[
8080
"@babel/plugin-proposal-class-properties",
8181
{

README-cn.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# AntdFront
44

55
AntdFront 是一套基于 Ant Design 的实验性、拥抱 react hook,纯函数,实现按钮级权限,使用下一代数据流, 微前端框架 qiankun 的 多标签 React 前端模板
6+
如果你需要前端完整应用权限实例,欢迎参考:[X-plat](https://github.com/X-neuron/x-plat.git)
67

78
## 特性
89

@@ -42,4 +43,6 @@ https://zhuanlan.zhihu.com/p/141738683
4243

4344
## 使用注意
4445

45-
recoil,webpack5 react17 i18n(lingui.js) prolayout react-router6 权限 prolayout 布局 微前端路由 已迁移完成
46+
由于 Antdesign 4 部分组件对react 18 的支持不够理想,使用时暂不建议升级至react18..
47+
48+
致谢:[qiujie8092916](https://github.com/qiujie8092916) 提供typescript版

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ English | [简体中文](./README-cn.md)
22

33
# AntdFront
44

5-
Antdfront is a set of multi label experimental react microfrontend template based on ant design, embracing react hook, pure function, realizing button level access, using the next generation of data flow and micro front-end framework Qiankun
5+
Antdfront is a set of multi label experimental react microfrontend template based on ant design, embracing react hook, pure function, realizing button level access, using the next generation of data flow and micro front-end framework Qiankun.
6+
7+
If you need a full application permission instance of the front end, please refer to: [x-plat](https://github.com/X-neuron/x-plat.git)
68

79
<img src="https://i.postimg.cc/QxHf9KZP/1111.gif" >
810

@@ -40,4 +42,6 @@ https://zhuanlan.zhihu.com/p/141738683
4042

4143
## Documentation
4244

43-
recoil,webpack5 react17 i18n( lingui.js )Prolayout react-router6 prolayout permission micro front-end routing migration completed
45+
Since some of Ant Design 4's components is not well support for react 18, it is not recommended to upgrade to react 18..
46+
47+
Thanks:[qiujie8092916](https://github.com/qiujie8092916) offer the typescript edition

package.json

+91-91
Original file line numberDiff line numberDiff line change
@@ -59,144 +59,144 @@
5959
"scoffold"
6060
],
6161
"devDependencies": {
62-
"@babel/cli": "^7.16.0",
63-
"@babel/core": "^7.16.5",
64-
"@babel/eslint-parser": "^7.16.5",
65-
"@babel/eslint-plugin": "^7.16.5",
66-
"@babel/plugin-proposal-class-properties": "^7.16.5",
67-
"@babel/plugin-proposal-export-default-from": "^7.16.5",
68-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.5",
69-
"@babel/plugin-proposal-numeric-separator": "^7.16.5",
70-
"@babel/plugin-proposal-optional-chaining": "^7.16.5",
62+
"@babel/cli": "^7.17.6",
63+
"@babel/core": "^7.17.9",
64+
"@babel/eslint-parser": "^7.17.0",
65+
"@babel/eslint-plugin": "^7.17.7",
66+
"@babel/plugin-proposal-class-properties": "^7.16.7",
67+
"@babel/plugin-proposal-export-default-from": "^7.16.7",
68+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
69+
"@babel/plugin-proposal-numeric-separator": "^7.16.7",
70+
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
7171
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
72-
"@babel/plugin-syntax-jsx": "^7.16.5",
73-
"@babel/plugin-transform-modules-commonjs": "^7.16.5",
74-
"@babel/plugin-transform-react-constant-elements": "^7.16.5",
75-
"@babel/plugin-transform-react-display-name": "^7.16.5",
76-
"@babel/plugin-transform-react-jsx": "^7.16.5",
77-
"@babel/plugin-transform-runtime": "^7.16.5",
78-
"@babel/preset-env": "^7.16.5",
79-
"@babel/preset-react": "^7.16.5",
72+
"@babel/plugin-syntax-jsx": "^7.16.7",
73+
"@babel/plugin-transform-modules-commonjs": "^7.17.9",
74+
"@babel/plugin-transform-react-constant-elements": "^7.17.6",
75+
"@babel/plugin-transform-react-display-name": "^7.16.7",
76+
"@babel/plugin-transform-react-jsx": "^7.17.3",
77+
"@babel/plugin-transform-runtime": "^7.17.0",
78+
"@babel/preset-env": "^7.16.11",
79+
"@babel/preset-react": "^7.16.7",
8080
"@babel/preset-typescript": "^7.16.7",
81-
"@lingui/cli": "^3.13.0",
82-
"@lingui/macro": "^3.13.0",
83-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
84-
"@svgr/webpack": "^6.1.2",
85-
"@types/lodash": "^4.14.178",
81+
"@lingui/cli": "^3.13.2",
82+
"@lingui/macro": "^3.13.2",
83+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
84+
"@svgr/webpack": "^6.2.1",
85+
"@types/lodash": "^4.14.181",
8686
"@types/qs": "^6.9.7",
87-
"@types/react": "^17.0.2",
88-
"@types/react-dom": "^17.0.2",
89-
"@typescript-eslint/eslint-plugin": "^4.29.3",
90-
"@typescript-eslint/parser": "^4.29.3",
91-
"@umijs/babel-plugin-auto-css-modules": "^3.5.20",
92-
"babel-loader": "^8.2.3",
87+
"@types/react": "^17.0.43",
88+
"@types/react-dom": "^17.0.14",
89+
"@typescript-eslint/eslint-plugin": "^5.19.0",
90+
"@typescript-eslint/parser": "^5.19.0",
91+
"@umijs/babel-plugin-auto-css-modules": "^3.5.22",
92+
"babel-loader": "^8.2.4",
9393
"babel-plugin-dynamic-import-node": "^2.3.3",
9494
"babel-plugin-import": "^1.13.3",
9595
"babel-plugin-lodash": "^3.3.4",
9696
"babel-plugin-macros": "^3.1.0",
9797
"babel-plugin-named-asset-import": "^0.3.8",
9898
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
99-
"browserslist": "^4.19.1",
99+
"browserslist": "^4.20.2",
100100
"case-sensitive-paths-webpack-plugin": "^2.4.0",
101101
"circular-dependency-plugin": "^5.2.2",
102102
"compression-webpack-plugin": "^9.2.0",
103-
"copy-webpack-plugin": "^10.2.0",
103+
"copy-webpack-plugin": "^10.2.4",
104104
"cross-env": "^7.0.3",
105-
"cross-port-killer": "^1.3.0",
106-
"css-loader": "^6.5.1",
107-
"css-minimizer-webpack-plugin": "^3.3.0",
108-
"eslint": "^8.4.1",
109-
"eslint-config-airbnb": "^19.0.2",
105+
"cross-port-killer": "^1.4.0",
106+
"css-loader": "^6.7.1",
107+
"css-minimizer-webpack-plugin": "^3.4.1",
108+
"eslint": "^8.13.0",
109+
"eslint-config-airbnb": "^19.0.4",
110110
"eslint-config-airbnb-base": "^15.0.0",
111-
"eslint-config-prettier": "^8.3.0",
112-
"eslint-config-react-app": "^7.0.0",
111+
"eslint-config-prettier": "^8.5.0",
112+
"eslint-config-react-app": "^7.0.1",
113113
"eslint-friendly-formatter": "^4.0.1",
114114
"eslint-import-resolver-alias": "^1.1.2",
115115
"eslint-import-resolver-webpack": "^0.13.2",
116-
"eslint-plugin-compat": "^4.0.0",
116+
"eslint-plugin-compat": "^4.0.2",
117117
"eslint-plugin-html": "^6.2.0",
118-
"eslint-plugin-import": "^2.25.3",
119-
"eslint-plugin-jest": "^25.3.0",
118+
"eslint-plugin-import": "^2.26.0",
119+
"eslint-plugin-jest": "^26.1.4",
120120
"eslint-plugin-jsx-a11y": "^6.5.1",
121121
"eslint-plugin-markdown": "^2.2.1",
122122
"eslint-plugin-prettier": "^4.0.0",
123-
"eslint-plugin-promise": "^5.2.0",
124-
"eslint-plugin-react": "^7.27.1",
125-
"eslint-plugin-react-hooks": "^4.3.0",
123+
"eslint-plugin-promise": "^6.0.0",
124+
"eslint-plugin-react": "^7.29.4",
125+
"eslint-plugin-react-hooks": "^4.4.0",
126126
"eslint-webpack-plugin": "^3.1.1",
127127
"file-loader": "^6.2.0",
128-
"html-loader": "^3.0.1",
128+
"html-loader": "^3.1.0",
129129
"html-webpack-plugin": "^5.5.0",
130-
"husky": "^3.1.0",
131-
"jest": "^27.4.5",
130+
"husky": "^7.0.4",
131+
"jest": "^27.5.1",
132132
"less": "^4.1.2",
133133
"less-loader": "^10.2.0",
134-
"lint-staged": "10.5.1",
135-
"mini-css-extract-plugin": "^2.4.5",
134+
"lint-staged": "12.3.7",
135+
"mini-css-extract-plugin": "^2.6.0",
136136
"mockjs": "^1.1.0",
137-
"node-sass": "^7.0.0",
137+
"node-sass": "^7.0.1",
138138
"optimize-css-assets-webpack-plugin": "^6.0.1",
139-
"postcss": "^8.4.5",
139+
"postcss": "^8.4.12",
140140
"postcss-flexbugs-fixes": "^5.0.2",
141-
"postcss-import": "^14.0.2",
141+
"postcss-import": "^14.1.0",
142142
"postcss-less": "^6.0.0",
143143
"postcss-loader": "^6.2.1",
144144
"postcss-normalize": "^10.0.1",
145-
"postcss-preset-env": "^7.0.2",
145+
"postcss-preset-env": "^7.4.3",
146146
"postcss-safe-parser": "^6.0.0",
147-
"prettier": "^2.5.1",
147+
"prettier": "^2.6.2",
148148
"raw-loader": "^4.0.2",
149-
"react-dev-utils": "^12.0.0",
150-
"react-refresh": "^0.11.0",
151-
"resolve-url-loader": "^4.0.0",
152-
"sass": "^1.45.0",
153-
"sass-loader": "^12.4.0",
154-
"source-map-loader": "^3.0.0",
149+
"react-dev-utils": "^12.0.1",
150+
"react-refresh": "^0.12.0",
151+
"resolve-url-loader": "^5.0.0",
152+
"sass": "^1.50.0",
153+
"sass-loader": "^12.6.0",
154+
"source-map-loader": "^3.0.1",
155155
"style-loader": "^3.3.1",
156-
"stylelint": "^14.1.0",
157-
"stylelint-config-recommended": "^6.0.0",
156+
"stylelint": "^14.6.1",
157+
"stylelint-config-recommended": "^7.0.0",
158158
"stylelint-config-styled-components": "^0.1.1",
159159
"stylelint-processor-styled-components": "^1.10.0",
160160
"sugarss": "^4.0.1",
161-
"terser-webpack-plugin": "^5.3.0",
161+
"terser-webpack-plugin": "^5.3.1",
162162
"url-loader": "^4.1.1",
163-
"webpack": "^5.65.0",
163+
"webpack": "^5.72.0",
164164
"webpack-bundle-analyzer": "^4.5.0",
165-
"webpack-cli": "^4.9.1",
166-
"webpack-dashboard": "^3.3.6",
167-
"webpack-dev-server": "4.6.0",
168-
"webpack-manifest-plugin": "^4.0.2",
165+
"webpack-cli": "^4.9.2",
166+
"webpack-dashboard": "^3.3.7",
167+
"webpack-dev-server": "4.8.1",
168+
"webpack-manifest-plugin": "^5.0.0",
169169
"webpackbar": "^5.0.2",
170-
"workbox-webpack-plugin": "^6.4.2"
170+
"workbox-webpack-plugin": "^6.5.3"
171171
},
172172
"dependencies": {
173173
"@ant-design/icons": "^4.7.0",
174-
"@ant-design/pro-card": "^1.18.11",
175-
"@ant-design/pro-descriptions": "^1.10.16",
176-
"@ant-design/pro-field": "^1.29.0",
177-
"@ant-design/pro-form": "^1.50.0",
178-
"@ant-design/pro-layout": "^6.31.7",
179-
"@ant-design/pro-list": "^1.21.0",
180-
"@ant-design/pro-table": "^2.60.0",
181-
"@babel/runtime": "^7.16.5",
174+
"@ant-design/pro-card": "^1.19.3",
175+
"@ant-design/pro-descriptions": "^1.10.64",
176+
"@ant-design/pro-field": "^1.34.3",
177+
"@ant-design/pro-form": "^1.63.0",
178+
"@ant-design/pro-layout": "^6.34.10",
179+
"@ant-design/pro-list": "^1.21.51",
180+
"@ant-design/pro-table": "^2.71.4",
181+
"@babel/runtime": "^7.17.9",
182182
"@koale/useworker": "^4.0.2",
183-
"@lingui/core": "^3.12.1",
184-
"@lingui/react": "^3.13.0",
185-
"ahooks": "^3.0.5",
186-
"antd": "^4.17.3",
183+
"@lingui/core": "^3.13.2",
184+
"@lingui/react": "^3.13.2",
185+
"ahooks": "^3.3.0",
186+
"antd": "^4.19.5",
187187
"classnames": "^2.3.1",
188-
"history": "^5.1.0",
188+
"history": "^5.3.0",
189189
"lodash": "^4.17.21",
190-
"nano-memoize": "^1.2.1",
191-
"nanoid": "^3.1.30",
192-
"qiankun": "^2.6.3",
193-
"qs": "^6.10.2",
194-
"react": "^17.0.2",
190+
"nano-memoize": "^1.3.0",
191+
"nanoid": "^3.3.2",
192+
"qiankun": "^2.7.0",
193+
"qs": "^6.10.3",
194+
"react": "^17.0.0",
195195
"react-avatar-editor": "^12.0.0",
196-
"react-dom": "^17.0.2",
197-
"react-router-dom": "^6.1.1",
198-
"recoil": "^0.5.2",
199-
"typescript": "^4.5.5",
196+
"react-dom": "^17.0.0",
197+
"react-router-dom": "^6.3.0",
198+
"recoil": "^0.7.1",
199+
"typescript": "^4.6.3",
200200
"umi-request": "^1.4.0"
201201
},
202202
"author": "X-neuron",
@@ -205,6 +205,6 @@
205205
"url": "https://github.com/X-neuron/antdFront/issues"
206206
},
207207
"engines": {
208-
"node": ">=12.13.0"
208+
"node": ">=14.0.0"
209209
}
210210
}

src/app.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useRecoilValue } from "recoil";
77
import { appRouteAtom } from "@/atoms/route";
88
import Locale from "@/components/Locale";
99
import PageLoading from "@/components/PageLoading";
10+
// import { loginStateAtom } from "@/atoms/login";
1011

1112
const App: React.FC = () => {
1213
useFavicon("./public/favicon.ico");
@@ -17,6 +18,24 @@ const App: React.FC = () => {
1718

1819
const element = useRoutes(appRoute);
1920

21+
// const [login,setLogin] = useRecoilState(loginStateAtom);
22+
23+
// 免账号登陆逻辑...
24+
// useMount(async () => {
25+
// if(!login.isLogin){
26+
// // const res = await fastLogin();
27+
// if(res.data?.jwt){
28+
// const { route,permission} = res.data;
29+
// setLogin({
30+
// ...res.data,
31+
// route,
32+
// permission,
33+
// isLogin:true,
34+
// });
35+
// }
36+
// }
37+
// });
38+
2039
return (
2140
<Suspense fallback={<PageLoading />}>
2241
<Locale>{element}</Locale>

0 commit comments

Comments
 (0)