#
vincentlu
2025-02-11 7da161d707b597dd6b471c53995949f155dfa2d5
rsf-admin/src/page/tenant/TenantCreate.jsx
@@ -2,6 +2,7 @@
import {
    useTranslate,
    useNotify,
    useRefresh,
} from 'react-admin';
import {
    Dialog,
@@ -31,6 +32,7 @@
    const { open, setOpen } = props;
    const translate = useTranslate();
    const notify = useNotify();
    const refresh = useRefresh();
    const {
        control,
        handleSubmit,
@@ -85,10 +87,13 @@
    const onSubmit = (data) => {
        request.post('/tenant/init', data).then(res => {
            const { code, msg, data } = res.data;
            console.log(msg);
            if (code === 200) {
                notify(msg, { type: 'success', messageArgs: { _: msg } });
                setOpen(false);
                reset();
                refresh();
            } else {
                notify(msg, { type: 'error', messageArgs: { _: msg } });
            }
@@ -244,7 +249,7 @@
                                                        message: translate('ra.validation.required'),
                                                    },
                                                    pattern: {
                                                        value: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,13}$/,
                                                        value: /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d\.]{6,13}$/,
                                                        message: translate('page.settings.resetPwd.tip.pwdInputLimit'),
                                                    },
                                                }}