diff --git a/src/assets/css/components/common/card.scss b/src/assets/css/components/common/card.scss new file mode 100644 index 0000000..a7688e6 --- /dev/null +++ b/src/assets/css/components/common/card.scss @@ -0,0 +1,5 @@ +.card-box { + border-radius: 8px; + overflow: hidden; + box-shadow: 5px 5px 10px 0 rgba(0,0,0,0.1); +} \ No newline at end of file diff --git a/src/assets/svg/log.svg b/src/assets/svg/log.svg new file mode 100644 index 0000000..1a0fffb --- /dev/null +++ b/src/assets/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/common/Card.tsx b/src/components/common/Card.tsx new file mode 100644 index 0000000..712bfde --- /dev/null +++ b/src/components/common/Card.tsx @@ -0,0 +1,12 @@ +import React from 'react' +import '@/assets/css/components/common/card.scss' + +interface CardProps + extends React.DetailedHTMLProps, HTMLDivElement> {} + +const Card: React.FC = (props) => { + const { className, ..._props } = props + return
+} + +export default Card diff --git a/src/components/common/FitCenter.tsx b/src/components/common/FitCenter.tsx index 7ada721..44f7449 100644 --- a/src/components/common/FitCenter.tsx +++ b/src/components/common/FitCenter.tsx @@ -9,14 +9,12 @@ interface FitCenterProps const FitCenter: React.FC = (props) => { const { className, vertical, ..._props } = props return ( - <> -
- +
) } diff --git a/src/components/common/FitFullScreen.tsx b/src/components/common/FitFullScreen.tsx index e7b84f9..2c3a49c 100644 --- a/src/components/common/FitFullScreen.tsx +++ b/src/components/common/FitFullScreen.tsx @@ -10,20 +10,16 @@ interface FitFullscreenProps const FitFullScreen = forwardRef((props, ref) => { const { zIndex, backgroundColor, className, style, ..._props } = props return ( - <> -
- {props.children} -
- +
) }) diff --git a/src/components/common/HideScrollbar.tsx b/src/components/common/HideScrollbar.tsx index 944c772..3448b0d 100644 --- a/src/components/common/HideScrollbar.tsx +++ b/src/components/common/HideScrollbar.tsx @@ -176,6 +176,7 @@ const HideScrollbar = forwardRef((prop scrollbarWidth, animationTransitionTime, autoHideWaitingTime, + children, ..._props } = props @@ -527,7 +528,7 @@ const HideScrollbar = forwardRef((prop style={{ minWidth, minHeight }} data-refresh={refreshTime} > - {props.children} + {children}
= { +interface _Response { code: number success: boolean msg: string data: T | null } -type Captcha = { +interface Captcha { value: string base64Src: string } -type TokenVo = { +interface TokenVo { token: string } -type UserWithPowerInfoVo = { +interface UserWithPowerInfoVo { id: string username: string locking: boolean @@ -75,7 +75,7 @@ type UserWithPowerInfoVo = { operations: OperationVo[] } -type UserWithRoleInfoVo = { +interface UserWithRoleInfoVo { id: string username: string locking: boolean @@ -91,7 +91,7 @@ type UserWithRoleInfoVo = { groups: GroupVo[] } -type UserInfoVo = { +interface UserInfoVo { id: string userId: string nickname: string @@ -99,13 +99,13 @@ type UserInfoVo = { email: string } -type ModuleVo = { +interface ModuleVo { id: number name: string powerId: number } -type MenuVo = { +interface MenuVo { id: number name: string url: string @@ -113,7 +113,7 @@ type MenuVo = { parentId: number } -type ElementVo = { +interface ElementVo { id: number name: string powerId: number @@ -121,7 +121,7 @@ type ElementVo = { menuId: number } -type OperationVo = { +interface OperationVo { id: number name: string code: string @@ -129,19 +129,37 @@ type OperationVo = { elementId: number } -type RoleVo = { +interface RoleVo { id: string name: string enable: boolean } -type GroupVo = { +interface GroupVo { id: string name: string enable: boolean } -type LoginForm = { +interface LoginForm { username: string password: string } + +interface SysLogGetVo { + id: string + logType: string + operateUserId: string + operateTime: Date + requestUri: string + requestMethod: string + requestParams: string + requestIp: string + requestServerAddress: string + isException: boolean + exceptionInfo: string + startTime: Date + endTime: Date + executeTime: number + userAgent: string +} diff --git a/src/pages/system/Log.tsx b/src/pages/system/Log.tsx new file mode 100644 index 0000000..53e3d05 --- /dev/null +++ b/src/pages/system/Log.tsx @@ -0,0 +1,34 @@ +import React, { useState } from 'react' +import FitFullScreen from '@/components/common/FitFullScreen.tsx' +import Card from '@/components/common/Card' +import { r_getSysLog } from '@/services/system.tsx' +import { DATABASE_SELECT_SUCCESS } from '@/constants/common.constants.ts' + +const Log: React.FC = () => { + const [logList, setLogList] = useState([]) + + const getLog = () => { + r_getSysLog().then((res) => { + const data = res.data + if (data.code === DATABASE_SELECT_SUCCESS) { + data.data && setLogList(data.data) + } + }) + } + + useEffect(() => { + getLog() + }, []) + + return ( + <> + + + + + + + ) +} + +export default Log diff --git a/src/router/system.tsx b/src/router/system.tsx index df920bd..4bdc155 100644 --- a/src/router/system.tsx +++ b/src/router/system.tsx @@ -43,6 +43,17 @@ const user: RouteJsonObject[] = [ permission: true, autoHide: true }, + { + path: 'log', + absolutePath: '/system/log', + id: 'system-log', + component: React.lazy(() => import('@/pages/system/Log')), + name: '系统日志', + icon: React.lazy(() => import('~icons/fatweb/log.jsx')), + menu: true, + permission: true, + autoHide: true + }, { path: '*', absolutePath: '*', diff --git a/src/services/system.tsx b/src/services/system.tsx new file mode 100644 index 0000000..6c73239 --- /dev/null +++ b/src/services/system.tsx @@ -0,0 +1,4 @@ +import request from '@/services/index' +import { URL_API_SYS_LOG } from '@/constants/urls.constants' + +export const r_getSysLog = () => request.get(URL_API_SYS_LOG)