fix:接口日志维护
This commit is contained in:
@@ -27,16 +27,17 @@
|
||||
<el-form-item label="请求参数">
|
||||
<span>{{ props.row.params }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="响应参数">
|
||||
<span>{{ props.row.return_result }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="requestIp" label="IP" />
|
||||
<el-table-column prop="request_ip" label="IP" />
|
||||
<el-table-column prop="method" label="接口方法" width="150" />
|
||||
<el-table-column prop="log_type" label="日志类型" />
|
||||
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||
<el-table-column prop="description" label="描述" show-overflow-tooltip />
|
||||
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="return_result" label="返回结果" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="time" label="请求耗时" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||
@@ -44,12 +45,20 @@
|
||||
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期" width="180px">
|
||||
<el-table-column prop="create_time" label="创建日期" width="180px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ parseTime(scope.row.create_time) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="异常详情" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" @click="info(scope.row.log_id)">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog :visible.sync="dialog" title="异常详情" append-to-body top="30px" width="85%">
|
||||
<pre v-highlightjs="errorInfo"><code class="java" /></pre>
|
||||
</el-dialog>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
@@ -69,6 +78,12 @@ export default {
|
||||
return CRUD({ title: '日志', url: 'api/interfaceLog' })
|
||||
},
|
||||
mixins: [presenter()],
|
||||
data() {
|
||||
return {
|
||||
errorInfo: '',
|
||||
dialog: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.crud.optShow = {
|
||||
add: false,
|
||||
@@ -96,6 +111,12 @@ export default {
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
info(log_id) {
|
||||
this.dialog = true
|
||||
crudInterfaceLog.getErrDetail(log_id).then(res => {
|
||||
this.errorInfo = res.exception
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,15 +126,18 @@ export default {
|
||||
.demo-table-expand {
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.demo-table-expand label {
|
||||
width: 70px;
|
||||
color: #99a9bf;
|
||||
}
|
||||
|
||||
.demo-table-expand .el-form-item {
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.demo-table-expand .el-form-item__content {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -7,16 +7,26 @@ export function add(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delLogs() {
|
||||
return request({
|
||||
url: 'api/interfaceLog/delLogs',
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getErrDetail(id) {
|
||||
return request({
|
||||
url: 'api/interfaceLog/error/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getLogTypeList() {
|
||||
return request({
|
||||
url: 'api/interfaceLog/logTypeList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export default { add, delLogs, getLogTypeList }
|
||||
|
||||
export default { add, delLogs, getLogTypeList, getErrDetail }
|
||||
|
||||
@@ -8,18 +8,27 @@
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.logType"
|
||||
<el-cascader
|
||||
placeholder="接口名称"
|
||||
:options="sects"
|
||||
clearable
|
||||
:props="{ checkStrictly: true }"
|
||||
filterable
|
||||
class="filter-item"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.log_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="日志类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in logTypeList"
|
||||
:label="item"
|
||||
:value="item"
|
||||
v-for="item in TypeList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
@@ -31,19 +40,46 @@
|
||||
import { header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import { getLogTypeList } from '@/views/monitor/interfaceLog/interfaceLog'
|
||||
import crudClassstandard from '@/views/wms/basedata/master/class/classstandard'
|
||||
|
||||
export default {
|
||||
components: { rrOperation, DateRangePicker },
|
||||
mixins: [header()],
|
||||
data() {
|
||||
return {
|
||||
logTypeList: []
|
||||
logTypeList: [],
|
||||
TypeList: [
|
||||
{ 'label': 'INFO', 'value': 'INFO' },
|
||||
{ 'label': 'ERROR', 'value': 'ERROR' }
|
||||
],
|
||||
sects: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
getLogTypeList().then(res => {
|
||||
this.logTypeList = res
|
||||
const param = {
|
||||
class_code: 'interface_type'
|
||||
}
|
||||
crudClassstandard.getCasClass(param).then(res => {
|
||||
const data = res.content
|
||||
this.sects = data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.log_dtl_info = val[0]
|
||||
this.query.method = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.log_dtl_info = ''
|
||||
this.query.method = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.log_dtl_info = val[0]
|
||||
this.query.method = val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -48,6 +48,7 @@ export function getClassType(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryClassById(params) {
|
||||
return request({
|
||||
url: 'api/Classstandard/queryClassById',
|
||||
@@ -55,6 +56,7 @@ export function queryClassById(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 传入分类标识和级别
|
||||
export function getType(params) {
|
||||
return request({
|
||||
@@ -79,4 +81,24 @@ export function getClassName() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName }
|
||||
export function getCasClass(data) {
|
||||
return request({
|
||||
url: 'api/Classstandard/getCasClass',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
del,
|
||||
getClass,
|
||||
getClassSuperior,
|
||||
getClassType,
|
||||
getClassTable,
|
||||
getType,
|
||||
queryClassById,
|
||||
getClassName,
|
||||
getCasClass
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user