Add permission
This commit is contained in:
@@ -24,6 +24,7 @@ import Icon from '@ant-design/icons'
|
|||||||
import compiler from '@/components/Playground/compiler.ts'
|
import compiler from '@/components/Playground/compiler.ts'
|
||||||
import { base64ToFiles, IMPORT_MAP_FILE_NAME, strToBase64 } from '@/components/Playground/files.ts'
|
import { base64ToFiles, IMPORT_MAP_FILE_NAME, strToBase64 } from '@/components/Playground/files.ts'
|
||||||
import { IImportMap } from '@/components/Playground/shared.ts'
|
import { IImportMap } from '@/components/Playground/shared.ts'
|
||||||
|
import Permission from '@/components/common/Permission.tsx'
|
||||||
|
|
||||||
const Tools = () => {
|
const Tools = () => {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
@@ -125,6 +126,7 @@ const Tools = () => {
|
|||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</a>
|
</a>
|
||||||
|
<Permission operationCode={['system:tool:modify:tool']}>
|
||||||
{record.review === 'PROCESSING' && (
|
{record.review === 'PROCESSING' && (
|
||||||
<a
|
<a
|
||||||
style={{ color: COLOR_PRODUCTION }}
|
style={{ color: COLOR_PRODUCTION }}
|
||||||
@@ -141,12 +143,15 @@ const Tools = () => {
|
|||||||
下架
|
下架
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
|
</Permission>
|
||||||
|
<Permission operationCode={['system:tool:delete:tool']}>
|
||||||
<a
|
<a
|
||||||
style={{ color: COLOR_PRODUCTION }}
|
style={{ color: COLOR_PRODUCTION }}
|
||||||
onClick={handleOnDeleteBtnClick(record)}
|
onClick={handleOnDeleteBtnClick(record)}
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</a>
|
</a>
|
||||||
|
</Permission>
|
||||||
</AntdSpace>{' '}
|
</AntdSpace>{' '}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ const system: RouteJsonObject[] = [
|
|||||||
absolutePath: '/system/tools/code',
|
absolutePath: '/system/tools/code',
|
||||||
id: 'system-tools-code',
|
id: 'system-tools-code',
|
||||||
component: lazy(() => import('@/pages/System/Tools/Code')),
|
component: lazy(() => import('@/pages/System/Tools/Code')),
|
||||||
|
operationCode: 'system:tool:query:tool',
|
||||||
name: '查看工具'
|
name: '查看工具'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -61,6 +62,7 @@ const system: RouteJsonObject[] = [
|
|||||||
absolutePath: '/system/tools/execute',
|
absolutePath: '/system/tools/execute',
|
||||||
id: 'system-tools-execute',
|
id: 'system-tools-execute',
|
||||||
component: lazy(() => import('@/pages/System/Tools/Execute')),
|
component: lazy(() => import('@/pages/System/Tools/Execute')),
|
||||||
|
operationCode: 'system:tool:query:tool',
|
||||||
name: '运行工具'
|
name: '运行工具'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user