import React from "react"; import Units from "../units"; import "./index.css"; import withRouter from "../routable/withroute"; import Login from "./login"; import HCDataSource from "../tmpl/hc-data-source"; import { Col, Row, theme } from "antd"; import { useLocale } from "../locale/useLocale"; import LocaleButton from "../locale/LocaleButton"; import Page2Img from "../../../public/page2.jpg"; const { useToken } = theme; interface RLoginitProps { params: object; autoSaveUser?: boolean; theme?: any; centerStyle?:object; themePosition?: "left" | "center" | "right" | undefined; } interface RLoginitState {} const RouterLogin = (props: RLoginitProps) => { const { token } = useToken(); const { params, autoSaveUser,centerStyle, themePosition, theme } = props; const { translate } = useLocale(); Units.setProgramCode4RoutePath(params); const getLogin = () => { return ( { HCDataSource.clear(); window.location.hash = "#/context-setter"; Units.setHydrocarbonToken(token); }} title={

{translate("${欢迎登录}")}

} autoSaveUser={autoSaveUser} /> ); }; const getContent = () => { if (themePosition) { if (themePosition == "left") { return ( <> {theme} {getLogin()} ); }else if (themePosition == "center"){ return ( <> {getLogin()} ); } } else { return ( <> {getLogin()} ); } }; return ( {getContent()} ); }; const I18nLogin = (props: RLoginitProps) => { return (
); }; export default withRouter(I18nLogin);