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

fix some warning

parent 3ca2f1e1
...@@ -3,7 +3,7 @@ export default { ...@@ -3,7 +3,7 @@ export default {
[ [
'umi-plugin-block-dev', 'umi-plugin-block-dev',
{ {
layout: 'ant-design-pro', layout: 'ant-design-pro-user',
menu: { menu: {
name: '主页', name: '主页',
icon: 'home', icon: 'home',
......
...@@ -29,6 +29,7 @@ export interface LoginItemProps { ...@@ -29,6 +29,7 @@ export interface LoginItemProps {
form?: FormComponentProps['form']; form?: FormComponentProps['form'];
customProps?: { [key: string]: any }; customProps?: { [key: string]: any };
onChange?: (e: any) => void; onChange?: (e: any) => void;
tabUtil?: any;
} }
interface LoginItemState { interface LoginItemState {
...@@ -107,7 +108,7 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> { ...@@ -107,7 +108,7 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> {
render() { render() {
const { count } = this.state; const { count } = this.state;
// 这么写是为了防止restProps中 带入 onChange, defaultValue, rules props // 这么写是为了防止restProps中 带入 onChange, defaultValue, rules props tabUtil
const { const {
onChange, onChange,
customProps, customProps,
...@@ -119,6 +120,7 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> { ...@@ -119,6 +120,7 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> {
updateActive, updateActive,
type, type,
form, form,
tabUtil,
...restProps ...restProps
} = this.props; } = this.props;
if (!name) { if (!name) {
...@@ -130,10 +132,11 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> { ...@@ -130,10 +132,11 @@ class WrapFormItem extends Component<LoginItemProps, LoginItemState> {
const { getFieldDecorator } = form; const { getFieldDecorator } = form;
// get getFieldDecorator props // get getFieldDecorator props
const options = this.getFormItemOptions(this.props); const options = this.getFormItemOptions(this.props);
const otherProps = restProps || {}; const otherProps = restProps || {};
if (type === 'Captcha') { if (type === 'Captcha') {
const inputProps = omit(otherProps, ['onGetCaptcha', 'countDown']); const inputProps = omit(otherProps, ['onGetCaptcha', 'countDown']);
return ( return (
<FormItem> <FormItem>
<Row gutter={8}> <Row gutter={8}>
......
import { routerRedux } from 'dva/router'; import { routerRedux } from 'dva/router';
import { getPageQuery, setAuthority } from './utils/utils'; import { getPageQuery, setAuthority } from './utils/utils';
import { fakeAccountLogin, getFakeCaptcha } from './service'; import { fakeAccountLogin, getFakeCaptcha } from './service';
import { stringify } from 'qs';
import { Reducer } from 'redux'; import { Reducer } from 'redux';
import { EffectsCommandMap } from 'dva'; import { EffectsCommandMap } from 'dva';
import { AnyAction } from 'redux'; import { AnyAction } from 'redux';
...@@ -23,7 +22,6 @@ export interface ModelType { ...@@ -23,7 +22,6 @@ export interface ModelType {
effects: { effects: {
login: Effect; login: Effect;
getCaptcha: Effect; getCaptcha: Effect;
logout: Effect;
}; };
reducers: { reducers: {
changeLoginStatus: Reducer<IStateType>; changeLoginStatus: Reducer<IStateType>;
...@@ -68,28 +66,6 @@ const Model: ModelType = { ...@@ -68,28 +66,6 @@ const Model: ModelType = {
*getCaptcha({ payload }, { call }) { *getCaptcha({ payload }, { call }) {
yield call(getFakeCaptcha, payload); 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: { reducers: {
......
import { parse } from 'query-string'; import { parse } from 'qs';
export function getPageQuery() { export function getPageQuery() {
return parse(window.location.href.split('?')[1]); return parse(window.location.href.split('?')[1]);
......
{ {
"private": true, "private": true,
"scripts": { "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": "npm run lint:ts && npm run lint:style && npm run lint:prettier",
"lint-staged": "lint-staged", "lint-staged": "lint-staged",
"lint-staged:ts": "tslint", "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