85 lines
2.5 KiB
Plaintext
85 lines
2.5 KiB
Plaintext
<template>
|
|
<a-modal v-model:visible="props.visible" title="登录日志详情" width="800px" @cancel="dialogClose">
|
|
<a-descriptions class="margin-top" :column="2" bordered :labelStyle="{ width: '120px' }">
|
|
<a-descriptions-item label="操作用户">
|
|
{{ formData.createUser }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="IP地址">
|
|
{{ formData.ip }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="操作系统">
|
|
{{ formData.os }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="操作浏览器">
|
|
{{ formData.browser }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="请求耗时"> {{ formData.consumeTime }}s </a-descriptions-item>
|
|
<a-descriptions-item label="请求地区">
|
|
{{ formData.location }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="请求方式">
|
|
{{ formData.requestMethod }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="请求状态">
|
|
<a-tag :color="formData.status ? 'danger' : 'success'">{{
|
|
formData.status ? '异常' : '正常'
|
|
}}</a-tag>
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="调用方法" :span="3">
|
|
{{ formData.method }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="请求参数" :span="3">
|
|
{{ formData.param }}
|
|
</a-descriptions-item>
|
|
<a-descriptions-item label="返回结果" :span="3">
|
|
{{ formData.result }}
|
|
</a-descriptions-item>
|
|
</a-descriptions>
|
|
<template #footer>
|
|
<span class="dialog-footer">
|
|
<a-button @click="dialogClose">取消</a-button>
|
|
</span>
|
|
</template>
|
|
</a-modal>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { getLoginLogDetail } from '@/api/system/loginLog';
|
|
import { onMounted, ref } from 'vue';
|
|
|
|
const emit = defineEmits(['success', 'update:visible']);
|
|
const formData = ref({});
|
|
|
|
const props = defineProps({
|
|
visible: {
|
|
type: Boolean,
|
|
required: true,
|
|
default: false,
|
|
},
|
|
loginlogId: {
|
|
type: Number,
|
|
required: true,
|
|
default: 0,
|
|
},
|
|
});
|
|
|
|
const dialogClose = () => {
|
|
emit('update:visible', false);
|
|
};
|
|
|
|
const setFormData = async () => {
|
|
const data = await getLoginLogDetail(props.loginlogId);
|
|
formData.value = data;
|
|
};
|
|
|
|
onMounted(() => {
|
|
if (props.loginlogId) {
|
|
setFormData();
|
|
}
|
|
});
|
|
</script>
|
|
<style lang="less" scoped>
|
|
:deep(.ant-descriptions__body .ant-descriptions__table .ant-descriptions__cell) {
|
|
word-break: break-all;
|
|
}
|
|
</style>
|