|
@@ -10,11 +10,14 @@ function ExceptionLog() {
|
|
|
useEffect(() => {
|
|
|
getAbnormalLog();
|
|
|
console.log(123);
|
|
|
-
|
|
|
+
|
|
|
}, []);
|
|
|
const [logList, setLogList] = useState([]);
|
|
|
const [total, setTotal] = useState(0);
|
|
|
const [size, setSize] = useState(15);
|
|
|
+ const [msvisible, setMsvisible] = useState(false);
|
|
|
+ const [tipText, setTipText] = useState('');
|
|
|
+
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
let list = []
|
|
@@ -29,7 +32,7 @@ function ExceptionLog() {
|
|
|
if (res.data.code === 200) {
|
|
|
const data = res.data.data;
|
|
|
console.log(data);
|
|
|
-
|
|
|
+
|
|
|
setLogList(data.records);
|
|
|
setTotal(data.total)
|
|
|
}
|
|
@@ -47,6 +50,28 @@ function ExceptionLog() {
|
|
|
params.size = pageSize
|
|
|
getAbnormalLog()
|
|
|
}
|
|
|
+ function showModal(operationWay) {
|
|
|
+ setMsvisible(true)
|
|
|
+ getAbnormalLogWayAndIp(operationWay)
|
|
|
+ }
|
|
|
+ function handleOk() {
|
|
|
+ setMsvisible(false)
|
|
|
+ }
|
|
|
+ function handleCancel() {
|
|
|
+ setMsvisible(false)
|
|
|
+ }
|
|
|
+ function getAbnormalLogWayAndIp(operationWay) {
|
|
|
+ let params = {
|
|
|
+ mark:0,
|
|
|
+ operationWay: operationWay
|
|
|
+ }
|
|
|
+ post(api.getAbnormalLogWayAndIp, params).then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ const data = res.data.data;
|
|
|
+ setTipText(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
const onFinish = (value) => {
|
|
|
params = {
|
|
|
...params,
|
|
@@ -74,6 +99,13 @@ function ExceptionLog() {
|
|
|
{ title: 'IP地址', dataIndex: 'operationIp', key: 'index' },
|
|
|
{ title: '用户代理', dataIndex: 'operationName', key: 'index' },
|
|
|
{ title: '创建时间', dataIndex: 'gmtCreate', key: 'index' },
|
|
|
+ {
|
|
|
+ title: '操作', dataIndex: 'key', render: (text, record) => (
|
|
|
+ <Space size="middle">
|
|
|
+ <a onClick={e => showModal(record.operationWay)}>查看</a>
|
|
|
+ </Space>
|
|
|
+ )
|
|
|
+ }
|
|
|
]
|
|
|
return (
|
|
|
<div className="wrapper">
|
|
@@ -127,6 +159,18 @@ function ExceptionLog() {
|
|
|
onChange: (page, pageSize) => changePage(page, pageSize),//点击页码事件
|
|
|
total: total
|
|
|
}} />
|
|
|
+
|
|
|
+ <Modal
|
|
|
+ title="查看异常"
|
|
|
+ okText='确定'
|
|
|
+ cancelText='取消'
|
|
|
+ width={400}
|
|
|
+ visible={msvisible}
|
|
|
+ onOk={handleOk}
|
|
|
+ onCancel={handleCancel}
|
|
|
+ >
|
|
|
+ <p>{tipText}</p>
|
|
|
+ </Modal>
|
|
|
</div>
|
|
|
</div >
|
|
|
)
|