优化代码

pull/43/head
smallbun 2023-09-08 12:41:07 +08:00
parent e96846e8fe
commit 207d0ff7f7
8 changed files with 195 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -136,7 +136,7 @@ const CreateUser = (props: CreateUserProps) => {
*/
const cancel = async () => {
if (onCancel) {
await onCancel();
onCancel();
}
setSubmitLoading(false);
form.resetFields();

View File

@ -38,3 +38,105 @@ export type GetApp = {
enabled: boolean;
remark: string;
};
/**
*
*/
export type AppAccessPolicyList = {
id: string;
//主体ID
subjectId: string;
//主体名称
subjectName: string;
//主体类型
subjectType: string;
//应用类型
appType: string;
appProtocol: string;
//Effect
effect: string;
};
/**
*
*/
type AppPermissionRoleList = {
id: string;
name: string;
code: string;
enabled: boolean;
appId: string;
remark: string;
};
/**
*
*/
type GetAppPermissionRole = {
id: string;
name: string;
code: string;
enabled: boolean;
appId: string;
remark: string;
};
/**
*
*/
type AppPermissionResourceList = {
id: string;
name: string;
code: string;
enabled: boolean;
desc: string;
appId: string;
};
/**
*
*/
type AppPermissionResourceActionList = {
id: string;
name: string;
code: string;
desc: string;
appId: string;
menus: {
access: string;
id: string;
name: string;
}[];
datas: {
access: string;
id: string;
name: string;
}[];
buttons: {
access: string;
id: string;
name: string;
}[];
apis: {
access: string;
id: string;
name: string;
}[];
others: {
access: string;
id: string;
name: string;
}[];
};
/**
*
*/
type AppPermissionPolicyList = {
id: string;
name: string;
code: string;
enabled: boolean;
desc: string;
appId: string;
};

View File

@ -18,3 +18,14 @@
export type SecurityDefensePolicyConfig = {
contentSecurityPolicy: string;
};
/**
*
*/
export type BasicSettingConfig = {
frequentRegisterCheck: boolean;
emailVerifiedDefault: boolean;
sendWelcomeEmail: boolean;
verifyOldEmail: boolean;
verifyOldPhone: boolean;
};

View File

@ -26,6 +26,7 @@ import MailTemplateConfig from './MailTemplateConfig';
import useStyle from './style';
import classnames from 'classnames';
import { useIntl } from '@umijs/max';
import { EmailTemplateList } from '../../data.d';
const prefixCls = 'setting-mail-template';
@ -36,7 +37,7 @@ export default (props: { visible: boolean }) => {
const [content, setContent] = useState<string>('');
const [configType, setConfigType] = useState<string>('');
const [loading, setLoading] = useState<boolean>(false);
const [dataSource, setDataSource] = useState<SettingAPI.EmailTemplateList[]>([]);
const [dataSource, setDataSource] = useState<EmailTemplateList[]>([]);
const [browseVisible, setBrowseVisible] = useState<boolean>(false);
const { styles } = useStyle(prefixCls);
const intl = useIntl();
@ -85,7 +86,7 @@ export default (props: { visible: boolean }) => {
<div className={styles.main}>
<ProCard className={`${prefixCls}`}>
<Spin spinning={loading}>
<ProList<SettingAPI.EmailTemplateList>
<ProList<EmailTemplateList>
rowKey="type"
split
cardProps={{ bodyStyle: { padding: 0 } }}

View File

@ -40,7 +40,7 @@ export interface GetBoundIdpList {
*
*/
export enum AccountSettingsStateKey {
BASE = 'base',
SECURITY = 'security',
BIND = 'bind',
base = 'base',
security = 'security',
bind = 'bind',
}

View File

@ -31,9 +31,15 @@ export enum InitLoginType {
/**
* SSO
*/
ONLY_APP_INIT_SSO = 'only_app_init_sso',
only_app_init_sso = 'only_app_init_sso',
/**
* SSO
*/
PORTAL_OR_APP_INIT_SSO = 'portal_or_app_init_sso',
portal_or_app_init_sso = 'portal_or_app_init_sso',
}
export type AppGroupList = {
id: string;
name: string;
appCount: number;
};

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import type { IDP_TYPE, MFA_FACTOR } from '@/constants';
import type { IDP_TYPE } from '@/constants';
/**
*
@ -44,9 +44,3 @@ export type IdpList = {
export type LoginConfig = {
idps: IdpList[];
};
export type MfaFactor = {
factor: MFA_FACTOR;
target?: string;
usable: boolean;
};