feat: gate permission

This commit is contained in:
archer
2025-05-30 16:04:33 +08:00
parent e74ab643fe
commit 81202c53a8
6 changed files with 204 additions and 55 deletions

View File

@@ -62,11 +62,15 @@ const AccountContainer = ({
label: t('account:usage_records'),
value: TabEnum.usage
},
{
icon: 'support/gate/gateLight',
label: t('account:gateways'),
value: TabEnum.gateway
}
...(userInfo?.team?.permission.hasManagePer
? [
{
icon: 'support/gate/gateLight',
label: t('account:gateways'),
value: TabEnum.gateway
}
]
: [])
]
: []),
...(feConfigs?.show_pay && userInfo?.team?.permission.hasManagePer

View File

@@ -338,7 +338,8 @@ const AppTable = () => {
);
const { openConfirm: openConfirmDel, ConfirmModal: DelConfirmModal } = useConfirm({
type: 'delete'
type: 'delete',
title: '确认删除该应用?'
});
const { runAsync: onDeleteApp } = useRequest2(delAppById, {
@@ -487,12 +488,11 @@ const AppTable = () => {
flexDirection={{ base: 'column', md: 'row' }}
alignItems={{ base: 'stretch', md: 'center' }}
>
<Flex flex={1} gap={4}>
<Flex gap={4}>
<SearchInput
value={search}
onChange={(e) => setSearch(e.target.value)}
placeholder={t('app:search_app')}
flex={1}
/>
<Box w="200px">
<Menu closeOnSelect={false}>

View File

@@ -158,12 +158,7 @@ const CopyrightTable = ({
{t('account_gate:gate_logo')}
</Text>
<Flex
gap={{ base: 4, md: 8 }}
alignItems="center"
justifyContent="flex-start"
flexDirection={{ base: 'column', md: 'row' }}
>
<Flex gap={{ base: 4, md: 8 }} alignItems="center" justifyContent="flex-start">
{/* 左侧 Banner 显示 - 带文字 */}
<Flex direction="column" gap={2} alignItems="center">
<Box
@@ -369,8 +364,8 @@ const CopyrightTable = ({
<LogoFile
onSelect={(e: File[]) =>
onSelectLogoImage(e, {
maxH: 300,
maxW: 300,
maxH: 3000,
maxW: 3000,
callback: (e: string) => {
setValue('logo', e);
handleGateLogoChange(e);
@@ -382,8 +377,8 @@ const CopyrightTable = ({
<BannerFile
onSelect={(e: File[]) =>
onSelectBannerImage(e, {
maxH: 300,
maxW: 300,
maxH: 3000,
maxW: 3000,
callback: (e: string) => {
setValue('banner', e);
handleGateBannerChange(e);