mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-25 01:40:20 +00:00
fix bug
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
"no-eval": 0,
|
||||
"react/jsx-no-bind": 0,
|
||||
"no-unused-vars": [2, { "ignoreRestSiblings": true }],
|
||||
"no-underscore-dangle": 0,
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
|
||||
@@ -207,7 +207,6 @@ export default {
|
||||
const result = yield call(queryWeather, { cityCode: myCityResult.selectCityCode })
|
||||
const weather = zuimei.parseActualData(result.data.actual)
|
||||
weather.city = myCityResult.selectCityName
|
||||
|
||||
yield put({ type: 'queryWeatherSuccess', payload: {
|
||||
weather,
|
||||
} })
|
||||
|
||||
+5
-1
@@ -34,7 +34,11 @@ export default {
|
||||
},
|
||||
|
||||
effects: {
|
||||
*query ({ payload }, { call, put }) {
|
||||
*query ({ payload }, { call, put, select }) {
|
||||
const { app } = yield select(state => state)
|
||||
if (!app.login) {
|
||||
return
|
||||
}
|
||||
const data = yield call(query, parse(payload))
|
||||
if (data) {
|
||||
yield put({
|
||||
|
||||
+6
-3
@@ -1,5 +1,5 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Router } from 'dva/router'
|
||||
import { Router, routerRedux } from 'dva/router'
|
||||
import App from './routes/app'
|
||||
|
||||
const cached = {}
|
||||
@@ -11,8 +11,11 @@ const registerModel = (app, model) => {
|
||||
}
|
||||
|
||||
const Routers = function ({ history, app }) {
|
||||
const handleChildRoute = ({ location, params, routes }) => {
|
||||
console.log(location, params, routes)
|
||||
const handleChildRoute = ({ location }) => {
|
||||
const state = app._store.getState()
|
||||
if (!state.app.login && location.pathname !== '/login') {
|
||||
app._store.dispatch(routerRedux.push('/login'))
|
||||
}
|
||||
}
|
||||
|
||||
const routes = [
|
||||
|
||||
Reference in New Issue
Block a user