This commit is contained in:
saplf
2019-09-08 01:24:27 +08:00
parent 1c0e5ddb66
commit 8282bb81d4
11 changed files with 82 additions and 33 deletions

View File

@@ -8,6 +8,7 @@ import { formatMessage } from 'umi-plugin-locale';
import { validPwd, validPhone, validPhoneInput } from '@/utils/validate';
import { changePhone, sendCode } from './service';
import { dispatch } from '@/utils/utils';
import { encodePhone } from '@/utils/transform';
export interface ChphoneModelState {
pageState: PageState;
@@ -75,8 +76,8 @@ const model: Model = {
if (!code) return message.warn(formatMessage({ id: 'check.msgCode' }));
yield put({ type: 'onUpdateState', submitting: true });
try {
yield call(changePhone, phone, code);
yield put({ type: 'user/updateUser', payload: { phone } });
yield call(changePhone, areacode, phone, code);
yield put({ type: 'user/updateUser', payload: { phone: encodePhone(areacode, phone) } });
Modal.success({
okText: formatMessage({ id: 'common.iknow' }),
title: formatMessage({ id: 'common.prompt' }),