|
@@ -8,7 +8,6 @@ export default {
|
|
state: {
|
|
state: {
|
|
loading: false,
|
|
loading: false,
|
|
tipsCount: {},
|
|
tipsCount: {},
|
|
- homeCount: {},
|
|
|
|
},
|
|
},
|
|
reducers: {
|
|
reducers: {
|
|
updateState(state, {payload}) {
|
|
updateState(state, {payload}) {
|
|
@@ -21,7 +20,8 @@ export default {
|
|
effects: {
|
|
effects: {
|
|
* authLogin({payload, callback, unLogin}, {call, put}) {
|
|
* authLogin({payload, callback, unLogin}, {call, put}) {
|
|
const result = yield call(authService.authLogin, payload);
|
|
const result = yield call(authService.authLogin, payload);
|
|
- if (!result.code) {
|
|
|
|
|
|
+ // token错误,error=true
|
|
|
|
+ if (!result.code && !result.data.error) {
|
|
const data = {
|
|
const data = {
|
|
token: result.data.token,
|
|
token: result.data.token,
|
|
username: result.data.username,
|
|
username: result.data.username,
|
|
@@ -81,16 +81,6 @@ export default {
|
|
}
|
|
}
|
|
yield put(createAction('queryList')({loading: false}));
|
|
yield put(createAction('queryList')({loading: false}));
|
|
},
|
|
},
|
|
- * fetchHomeCount({payload}, {call, put}) {
|
|
|
|
- yield put(createAction('updateState')({homeCount: {}, loading: true}));
|
|
|
|
- const response = yield call(authService.queryHomeCount);
|
|
|
|
- if (!response.code) {
|
|
|
|
- yield put(createAction('updateState')({homeCount: response.data, loading: false}));
|
|
|
|
- } else {
|
|
|
|
- ResponseError(response);
|
|
|
|
- yield put(createAction('updateState')({homeCount: {}, loading: false}));
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
* fetchTipsCount({payload}, {call, put}) {
|
|
* fetchTipsCount({payload}, {call, put}) {
|
|
yield put(createAction('updateState')({loading: true}));
|
|
yield put(createAction('updateState')({loading: true}));
|
|
const response = yield call(authService.queryTipsCount);
|
|
const response = yield call(authService.queryTipsCount);
|