mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
* feat(plugin-verification): add client config * feat(plugin-verification): add config ui * fix(plugin-verification): fix schema * refactor(plugin-verification): add default for verification providers * fix(plugin-users): fix initVerification in lifecycle * fix(plugin-users): fix initVerification in lifecycle * fix(plugin-verification): fix locale and default provider * fix(plugin-verification): fix test case * fix(plugin-verification): fix locale
23 lines
768 B
TypeScript
23 lines
768 B
TypeScript
import React, { useEffect, useState } from 'react';
|
|
import { FormLayout } from '@formily/antd';
|
|
import { Field } from '@formily/core';
|
|
import { observer, RecursionField, Schema, useField, useForm } from '@formily/react';
|
|
|
|
import providerTypes from './providerTypes';
|
|
|
|
|
|
export default observer((props) => {
|
|
const form = useForm();
|
|
const field = useField<Field>();
|
|
const [s, setSchema] = useState(new Schema({}));
|
|
useEffect(() => {
|
|
form.clearFormGraph('options.*');
|
|
setSchema(new Schema(providerTypes.get(form.values.type) || {}));
|
|
}, [form.values.type]);
|
|
return (
|
|
<FormLayout layout={'vertical'}>
|
|
<RecursionField key={form.values.type || 'sms-aliyun'} basePath={field.address} onlyRenderProperties schema={s} />
|
|
</FormLayout>
|
|
);
|
|
});
|