fix: translation
This commit is contained in:
parent
e6a2dff79a
commit
966b4e3459
@ -555,4 +555,5 @@ export default {
|
||||
"View all plugins": "View all plugins",
|
||||
"Print": "Print",
|
||||
'Single select and radio fields can be used as the grouping field': 'Single select and radio fields can be used as the grouping field',
|
||||
'Sign up successfully, and automatically jump to the sign in page': 'Sign up successfully, and automatically jump to the sign in page',
|
||||
}
|
||||
|
@ -659,4 +659,5 @@ export default {
|
||||
"Enabled languages": "启用的语言",
|
||||
"View all plugins": "查看所有插件",
|
||||
"Print": "打印",
|
||||
'Sign up successfully, and automatically jump to the sign in page': '注册成功,即将跳转到登录页面',
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import { ISchema, useForm } from '@formily/react';
|
||||
import { uid } from '@formily/shared';
|
||||
import { message } from 'antd';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Redirect, useHistory } from 'react-router-dom';
|
||||
import { SchemaComponent, useAPIClient, useCurrentDocumentTitle, useSystemSettings } from '..';
|
||||
import VerificationCode from './VerificationCode';
|
||||
@ -26,7 +27,7 @@ const schema: ISchema = {
|
||||
'x-validator': 'phone',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component-props': { placeholder: '{{t("Phone")}}', style: {} },
|
||||
'x-visible': '{{smsAuthEnabled}}'
|
||||
'x-visible': '{{smsAuthEnabled}}',
|
||||
},
|
||||
code: {
|
||||
type: 'string',
|
||||
@ -37,7 +38,7 @@ const schema: ISchema = {
|
||||
targetFieldName: 'phone',
|
||||
},
|
||||
'x-decorator': 'FormItem',
|
||||
'x-visible': '{{smsAuthEnabled}}'
|
||||
'x-visible': '{{smsAuthEnabled}}',
|
||||
},
|
||||
password: {
|
||||
type: 'string',
|
||||
@ -110,13 +111,14 @@ export const useSignup = () => {
|
||||
const history = useHistory();
|
||||
const form = useForm();
|
||||
const api = useAPIClient();
|
||||
const { t } = useTranslation();
|
||||
return {
|
||||
async run() {
|
||||
await form.submit();
|
||||
await api.resource('users').signup({
|
||||
values: form.values,
|
||||
});
|
||||
message.success('注册成功,即将跳转登录页');
|
||||
message.success('Sign up successfully, and automatically jump to the sign in page');
|
||||
setTimeout(() => {
|
||||
history.push('/signin');
|
||||
}, 2000);
|
||||
@ -135,7 +137,7 @@ export const SignupPage = () => {
|
||||
<SchemaComponent
|
||||
schema={schema}
|
||||
components={{
|
||||
VerificationCode
|
||||
VerificationCode,
|
||||
}}
|
||||
scope={{ useSignup, smsAuthEnabled }}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user