| | |
| | | import { PROJECT_NAME } from '@/config/setting' |
| | | import Http from '@/utils/http'; |
| | | |
| | | import logo from './logo.png' |
| | | import logo from '/public/img/logo.png' |
| | | import logoBg from '/public/login-bg.mp4' |
| | | |
| | | const LoginMessage = ({ content }) => { |
| | | return ( |
| | |
| | | const storedValue = localStorage.getItem('rememberData'); |
| | | return storedValue !== null ? JSON.parse(storedValue) : true; |
| | | }); |
| | | const [hostList, setHostList] = useState([]); |
| | | |
| | | useEffect(() => { |
| | | form.setFieldsValue({ |
| | |
| | | localStorage.setItem('rememberData', JSON.stringify(rememberData)); |
| | | }, [rememberData]) |
| | | |
| | | useEffect(() => { |
| | | const fetchHostList = async () => { |
| | | const resp = await Http.doGet('api/auth/host'); |
| | | const list = resp.data.map(item => ({ |
| | | label: item.name, |
| | | value: item.id |
| | | })); |
| | | setHostList(list); |
| | | if (list && list.length > 0) { |
| | | form.setFieldsValue({ |
| | | hostId: list[0].value |
| | | }); |
| | | } |
| | | } |
| | | fetchHostList(); |
| | | }, []); |
| | | |
| | | const fetchUserInfo = async () => { |
| | | const userInfo = await initialState?.fetchUserInfo?.(); |
| | | if (userInfo) { |
| | |
| | | } |
| | | }; |
| | | |
| | | const fetchHostList = async () => { |
| | | const res = await Http.doGet('api/auth/host', {}) |
| | | console.log(res.data); |
| | | } |
| | | fetchHostList(); |
| | | |
| | | const handleSubmit = async (values) => { |
| | | try { |
| | |
| | | > |
| | | <LoginFormPage |
| | | form={form} |
| | | backgroundImageUrl="https://mdn.alipayobjects.com/huamei_gcee1x/afts/img/A*y0ZTS6WLwvgAAAAAAAAAAAAADml6AQ/fmt.webp" |
| | | logo={logo} |
| | | backgroundVideoUrl="https://gw.alipayobjects.com/v/huamei_gcee1x/afts/video/jXRBRK_VAwoAAAAAAAAAAAAAK4eUAQBr" |
| | | backgroundVideoUrl={logoBg} |
| | | // title="陆晓涛" |
| | | // subTitle="陆晓涛..." |
| | | containerStyle={{ |
| | |
| | | }} |
| | | onFinish={async (values) => { |
| | | await handleSubmit(values); |
| | | }} |
| | | initialValue={{ |
| | | }} |
| | | > |
| | | <Tabs |
| | |
| | | message: '请选择机构!', |
| | | }, |
| | | ]} |
| | | debounceTime={300} |
| | | request={async ({ keyWords }) => { |
| | | const resp = await Http.doGet('api/auth/host', {}); |
| | | return resp.data.map(item => ({ |
| | | label: item.name, |
| | | value: item.id |
| | | })); |
| | | }} |
| | | options={hostList} |
| | | /> |
| | | <ProFormText |
| | | name="username" |
| | |
| | | )} |
| | | {loginType === 'phone' && ( |
| | | <> |
| | | <ProFormSelect |
| | | className="centered-select" |
| | | name="hostId" |
| | | placeholder="机构:" |
| | | rules={[ |
| | | { |
| | | required: true, |
| | | message: '请选择机构!', |
| | | }, |
| | | ]} |
| | | options={hostList} |
| | | /> |
| | | <ProFormText |
| | | fieldProps={{ |
| | | size: 'large', |
| | |
| | | <Page /> |
| | | </ProConfigProvider> |
| | | ); |
| | | }; |
| | | }; |