mirror of
https://github.com/zuiidea/antd-admin.git
synced 2024-04-21 12:32:14 +00:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
+6
-6
@@ -49,12 +49,12 @@
|
||||
"cross-env": "^5.2.0",
|
||||
"eslint": "^5.15.0",
|
||||
"eslint-config-react-app": "^4.0.0",
|
||||
"eslint-plugin-flowtype": "^3.4.0",
|
||||
"eslint-plugin-import": "^2.17.0",
|
||||
"eslint-plugin-flowtype": "^3.11.0",
|
||||
"eslint-plugin-import": "^2.18.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"eslint-plugin-react": "^7.13.0",
|
||||
"eslint-plugin-react": "^7.14.0",
|
||||
"eslint-plugin-react-hooks": "^1.6.0",
|
||||
"husky": "^2.3.0",
|
||||
"husky": "^2.7.0",
|
||||
"less-vars-to-js": "^1.3.0",
|
||||
"lint-staged": "^8.1.0",
|
||||
"mockjs": "^1.0.1-beta3",
|
||||
@@ -63,8 +63,8 @@
|
||||
"stylelint": "^10.0.0",
|
||||
"stylelint-config-prettier": "^5.2.0",
|
||||
"stylelint-config-standard": "^18.3.0",
|
||||
"umi": "^2.8.1",
|
||||
"umi-plugin-react": "^1.9.1"
|
||||
"umi": "^2.8.7",
|
||||
"umi-plugin-react": "^1.9.6"
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.js": [
|
||||
|
||||
+6
-2
@@ -69,9 +69,11 @@ export default {
|
||||
},
|
||||
effects: {
|
||||
*query({ payload }, { call, put, select }) {
|
||||
const { success, user } = yield call(queryUserInfo, payload)
|
||||
// store isInit to prevent query trigger by refresh
|
||||
const isInit = store.get('isInit')
|
||||
if (isInit) return
|
||||
const { locationPathname } = yield select(_ => _.app)
|
||||
|
||||
const { success, user } = yield call(queryUserInfo, payload)
|
||||
if (success && user) {
|
||||
const { list } = yield call(queryRouteList)
|
||||
const { permissions } = user
|
||||
@@ -96,6 +98,7 @@ export default {
|
||||
store.set('routeList', routeList)
|
||||
store.set('permissions', permissions)
|
||||
store.set('user', user)
|
||||
store.set('isInit', true)
|
||||
if (pathMatchRegexp(['/', '/login'], window.location.pathname)) {
|
||||
router.push({
|
||||
pathname: '/dashboard',
|
||||
@@ -117,6 +120,7 @@ export default {
|
||||
store.set('routeList', [])
|
||||
store.set('permissions', { visit: [] })
|
||||
store.set('user', {})
|
||||
store.set('isInit', false)
|
||||
yield put({ type: 'query' })
|
||||
} else {
|
||||
throw data
|
||||
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
const { from } = locationQuery
|
||||
yield put({ type: 'app/query' })
|
||||
if (!pathMatchRegexp('/login', from)) {
|
||||
if (from === '/') router.push('/dashboard')
|
||||
if (['', '/'].includes(from)) router.push('/dashboard')
|
||||
else router.push(from)
|
||||
} else {
|
||||
router.push('/dashboard')
|
||||
|
||||
Reference in New Issue
Block a user