forgeplus-react/src/components/AuthenticationModel/index.tsx

74 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { FC } from 'react';
import {
ShixunsDetailModelState,
GlobalSettingModelState,
ConnectProps,
Loading,
connect,
Dispatch,
} from 'umi';
import { Modal, message } from 'antd';
import Fetch from '@/utils/fetch';
interface PageProps extends Partial<ConnectProps> {
shixunsDetail: ShixunsDetailModelState;
globalSetting: GlobalSettingModelState;
loading: boolean;
dispatch: Dispatch;
}
const AuthModal: FC<PageProps> = ({
shixunsDetail,
globalSetting,
loading,
dispatch,
...props
}) => {
return (
<Modal
centered
keyboard={false}
closable={false}
zIndex={6666}
title="提示"
visible={shixunsDetail.actionTabs.key === 'Banner-Auth'}
okText="确定"
cancelText="取消"
onOk={() => {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {},
});
window.location.href = 'https://www.educoder.net/account/certification';
}}
onCancel={() => {
dispatch({
type: 'shixunsDetail/setActionTabs',
payload: {},
});
}}
>
<p className="tc font16">
<br />
</p>
</Modal>
);
};
export default connect(
({
shixunsDetail,
loading,
globalSetting,
}: {
shixunsDetail: ShixunsDetailModelState;
loading: Loading;
globalSetting: GlobalSettingModelState;
}) => ({
shixunsDetail,
globalSetting,
loading: loading.models.index,
}),
)(AuthModal);