@wang1212/create-web-app
Advanced tools
Comparing version 0.2.6 to 0.2.7
{ | ||
"name": "@wang1212/create-web-app", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"keywords": [ | ||
@@ -35,5 +35,5 @@ "web-app", | ||
"dependencies": { | ||
"chalk": "^2.4.2", | ||
"chalk": "^3.0.0", | ||
"fs-extra": "^8.1.0" | ||
} | ||
} |
@@ -24,8 +24,8 @@ { | ||
"devDependencies": { | ||
"@babel/core" : "^7.6.4", | ||
"@babel/core": "^7.7.2", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.6.2", | ||
"@babel/plugin-syntax-dynamic-import" : "^7.2.0", | ||
"@babel/preset-env" : "^7.6.3", | ||
"@babel/preset-env": "^7.7.1", | ||
"@babel/preset-flow" : "^7.0.0", | ||
"@babel/preset-typescript" : "^7.6.0", | ||
"@babel/preset-typescript": "^7.7.2", | ||
"babel-eslint" : "^10.0.3", | ||
@@ -35,10 +35,10 @@ "babel-jest" : "^24.9.0", | ||
"browser-sync" : "^2.26.7", | ||
"copy-webpack-plugin" : "^5.0.4", | ||
"copy-webpack-plugin": "^5.0.5", | ||
"css-loader" : "^3.2.0", | ||
"del" : "^5.1.0", | ||
"docdash" : "^1.1.1", | ||
"eslint" : "^6.5.1", | ||
"eslint": "^6.6.0", | ||
"file-loader" : "^4.2.0", | ||
"flow-bin" : "^0.110.0", | ||
"flow-typed" : "^2.6.1", | ||
"flow-bin": "^0.112.0", | ||
"flow-typed": "^2.6.2", | ||
"html-loader" : "^0.5.5", | ||
@@ -52,3 +52,3 @@ "html-webpack-plugin" : "^3.2.0", | ||
"mini-css-extract-plugin" : "^0.8.0", | ||
"node-sass" : "^4.12.0", | ||
"node-sass": "^4.13.0", | ||
"optimize-css-assets-webpack-plugin" : "^5.0.3", | ||
@@ -59,3 +59,3 @@ "postcss-loader" : "^3.0.0", | ||
"style-loader" : "^1.0.0", | ||
"typescript" : "^3.6.4", | ||
"typescript": "^3.7.2", | ||
"uglifyjs-webpack-plugin" : "^2.2.0", | ||
@@ -62,0 +62,0 @@ "url-loader" : "^2.2.0", |
@@ -12,5 +12,5 @@ /* App entry file */ | ||
document.write(` | ||
window['App'].innerHTML = ` | ||
<h1>App running !</h1> | ||
<p>${view}</p> | ||
`) | ||
` |
@@ -23,6 +23,6 @@ { | ||
"axios": "^0.19.0", | ||
"react": "^16.11.0", | ||
"react-dom": "^16.11.0", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react-jss": "^10.0.0", | ||
"react-redux": "^7.1.1", | ||
"react-redux": "^7.1.3", | ||
"react-router-dom": "^5.1.2", | ||
@@ -34,10 +34,10 @@ "redux": "^4.0.4", | ||
"devDependencies": { | ||
"@babel/core": "^7.6.4", | ||
"@babel/plugin-proposal-class-properties": "^7.5.5", | ||
"@babel/core": "^7.7.2", | ||
"@babel/plugin-proposal-class-properties": "^7.7.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.6.2", | ||
"@babel/plugin-syntax-dynamic-import": "^7.2.0", | ||
"@babel/preset-env": "^7.6.3", | ||
"@babel/preset-env": "^7.7.1", | ||
"@babel/preset-flow": "^7.0.0", | ||
"@babel/preset-react": "^7.6.3", | ||
"@babel/preset-typescript": "^7.6.0", | ||
"@babel/preset-react": "^7.7.0", | ||
"@babel/preset-typescript": "^7.7.2", | ||
"babel-eslint": "^10.0.3", | ||
@@ -47,12 +47,12 @@ "babel-jest": "^24.9.0", | ||
"browser-sync": "^2.26.7", | ||
"copy-webpack-plugin": "^5.0.4", | ||
"copy-webpack-plugin": "^5.0.5", | ||
"css-loader": "^3.2.0", | ||
"del": "^5.1.0", | ||
"docdash": "^1.1.1", | ||
"eslint": "^6.5.1", | ||
"eslint": "^6.6.0", | ||
"eslint-plugin-react": "^7.16.0", | ||
"eslint-plugin-react-hooks": "^2.2.0", | ||
"eslint-plugin-react-hooks": "^2.3.0", | ||
"file-loader": "^4.2.0", | ||
"flow-bin": "^0.110.0", | ||
"flow-typed": "^2.6.1", | ||
"flow-bin": "^0.112.0", | ||
"flow-typed": "^2.6.2", | ||
"html-loader": "^0.5.5", | ||
@@ -66,3 +66,3 @@ "html-webpack-plugin": "^3.2.0", | ||
"mini-css-extract-plugin": "^0.8.0", | ||
"node-sass": "^4.12.0", | ||
"node-sass": "^4.13.0", | ||
"optimize-css-assets-webpack-plugin": "^5.0.3", | ||
@@ -74,3 +74,3 @@ "postcss-loader": "^3.0.0", | ||
"style-loader": "^1.0.0", | ||
"typescript": "^3.6.4", | ||
"typescript": "^3.7.2", | ||
"uglifyjs-webpack-plugin": "^2.2.0", | ||
@@ -77,0 +77,0 @@ "url-loader": "^2.2.0", |
@@ -19,7 +19,7 @@ | ||
const SignInPage = loadable(() => import('./auth/SignInPage'), { | ||
const AsyncSignInPage = loadable(() => import('./auth/SignInPage'), { | ||
fallback: <div>Loading...</div> | ||
}); | ||
const AuthFilter = loadable(() => import('./AuthFilter'), { | ||
const AsyncPageRouter = loadable(() => import('./PageRouter'), { | ||
fallback: <div>Loading...</div> | ||
@@ -36,3 +36,3 @@ }); | ||
/** | ||
* - 禁止全页面右键菜单 | ||
* - page context menu | ||
*/ | ||
@@ -46,3 +46,3 @@ Array.from(document.querySelectorAll('body *')).forEach(el => { | ||
/** | ||
* - 刷新确认 | ||
* - reload page | ||
*/ | ||
@@ -64,4 +64,4 @@ window.onbeforeunload = event => { | ||
<Switch> | ||
<Route exact strict path="/sign-in" render={ props => <SignInPage { ...props } /> } /> | ||
<Route path="/" render={ props => <AuthFilter { ...props } /> } /> | ||
<Route exact strict path="/sign-in" render={ props => <AsyncSignInPage { ...props } /> } /> | ||
<Route path="/" render={ props => <AsyncPageRouter { ...props } /> } /> | ||
</Switch> | ||
@@ -68,0 +68,0 @@ </Router> |
@@ -12,5 +12,5 @@ /*! Sign In page Component */ | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { auth_sign_in, auth_get_signed_user } from 'reducers/Auth' | ||
import { Redirect } from 'react-router-dom'; | ||
import { auth_sign_in } from 'reducers/Auth'; | ||
@@ -51,2 +51,6 @@ import { createUseStyles } from 'react-jss'; | ||
useEffect(() => { | ||
dispatch(auth_get_signed_user()); | ||
}, []) | ||
useEffect(() => { | ||
const handle_check_enter = event => { | ||
@@ -53,0 +57,0 @@ if (event.keyCode === 13) handle_sign_in(); |
@@ -34,10 +34,25 @@ | ||
type Props = { | ||
location: any | ||
} | ||
/* Component */ | ||
const PageRouter = () => { | ||
const PageRouter = ({ location }: Props) => { | ||
const classes = useStyles(); | ||
const app = useSelector(state => state.App); | ||
const user = useSelector(state => state.Auth.user); | ||
if (!user) { | ||
return ( | ||
<Redirect | ||
to={ { | ||
pathname: '/sign-in', | ||
state: { from: location } | ||
} } | ||
/> | ||
) | ||
} | ||
return ( | ||
@@ -64,2 +79,2 @@ <section className={ classes.root }> | ||
export default React.memo<any>(PageRouter); | ||
export default React.memo<Props>(PageRouter); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
630821
90
1935
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedchalk@^3.0.0