import React from 'react'; import { Tabs } from 'antd-mobile'; import Style from './mobile.module.less'; import ByMobile from './byMobile/index'; import ByUserEntityGrant from './byUserEntityGrant'; import { assert } from 'oak-domain/lib/utils/assert'; export default function Render(props) { const { entity, entityId, relations, grantByUserEntityGrant, grantByEmail, grantByMobile, grantMethodCount, oakFullpath, redirectToAfterConfirm, qrCodeType, claimUrl, rule, ruleOnRow, passwordRequire, allowUpdateName, allowUpdateNickname, } = props.data; let SubPart = <>; if (grantMethodCount === 0) { SubPart = (
应用没有定义授权方式,请管理员在控制台中定义
); } else if (grantMethodCount === 1) { if (grantByEmail) { SubPart =
尚未实现
; } else if (grantByMobile) { SubPart = (); } else { assert(grantByUserEntityGrant === true); SubPart = (); } } else { const items = [ { label: 'Email', key: 'item-1', children:
尚未实现
, }, { label: '二维码', key: 'item-2', children: (), }, { label: '手机号', key: 'item-3', children: (), }, ]; const items2 = []; if (grantByEmail) { items2.push(items[0]); } if (grantByUserEntityGrant) { items2.push(items[1]); } if (grantByMobile) { items2.push(items[2]); } SubPart = ( {items2.map((ele) => ( {ele.children} ))} ); } return SubPart; }