| | |
| | | import { |
| | | useTranslate, |
| | | useNotify, |
| | | useRefresh, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | const { open, setOpen } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const { |
| | | control, |
| | | handleSubmit, |
| | |
| | | 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 } }); |
| | | } |
| | |
| | | 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'), |
| | | }, |
| | | }} |