Commit 33b1bd03 authored by 陈帅's avatar 陈帅

fix some warning

parent 3ca2f1e1
......@@ -3,7 +3,7 @@ export default {
[
'umi-plugin-block-dev',
{
layout: 'ant-design-pro',
layout: 'ant-design-pro-user',
menu: {
name: '主页',
icon: 'home',
......
......@@ -29,6 +29,7 @@ export interface LoginItemProps {
form?: FormComponentProps['form'];
customProps?: { [key: string]: any };
onChange?: (e: any) => void;
tabUtil?: any;
}
interface LoginItemState {
......@@ -107,7 +108,7 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> {
render() {
const { count } = this.state;
// 这么写是为了防止restProps中 带入 onChange, defaultValue, rules props
// 这么写是为了防止restProps中 带入 onChange, defaultValue, rules props tabUtil
const {
onChange,
customProps,
......@@ -119,6 +120,7 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> {
updateActive,
type,
form,
tabUtil,
...restProps
} = this.props;
if (!name) {
......@@ -130,10 +132,11 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> {
const { getFieldDecorator } = form;
// get getFieldDecorator props
const options = this.getFormItemOptions(this.props);
const otherProps = restProps || {};
if (type === 'Captcha') {
const inputProps = omit(otherProps, ['onGetCaptcha', 'countDown']);
return (
<FormItem>
<Row gutter={8}>
......
import { routerRedux } from 'dva/router';
import { getPageQuery, setAuthority } from './utils/utils';
import { fakeAccountLogin, getFakeCaptcha } from './service';
import { stringify } from 'qs';
import { Reducer } from 'redux';
import { EffectsCommandMap } from 'dva';
import { AnyAction } from 'redux';
......@@ -23,7 +22,6 @@ export interface ModelType {
effects: {
login: Effect;
getCaptcha: Effect;
logout: Effect;
};
reducers: {
changeLoginStatus: Reducer<IStateType>;
......@@ -68,28 +66,6 @@ const Model: ModelType = {
*getCaptcha({ payload }, { call }) {
yield call(getFakeCaptcha, payload);
},
*logout(_, { put }) {
yield put({
type: 'changeLoginStatus',
payload: {
status: false,
currentAuthority: 'guest',
},
});
const { redirect } = getPageQuery();
// redirect
if (window.location.pathname !== '/user/login' && !redirect) {
yield put(
routerRedux.replace({
pathname: '/user/login',
search: stringify({
redirect: window.location.href,
}),
}),
);
}
},
},
reducers: {
......
import { parse } from 'query-string';
import { parse } from 'qs';
export function getPageQuery() {
return parse(window.location.href.split('?')[1]);
......
{
"private": true,
"scripts": {
"dev": "cross-env PAGES_PATH='AccountCenter/src' umi dev",
"dev": "cross-env PAGES_PATH='UserLogin/src' umi dev",
"lint": "npm run lint:ts && npm run lint:style && npm run lint:prettier",
"lint-staged": "lint-staged",
"lint-staged:ts": "tslint",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment