This commit is contained in:
777
2025-12-22 10:17:38 +08:00
parent 43f9e82c74
commit b1a934793e
2 changed files with 100 additions and 0 deletions

10
src/api/cai/loginLog.js Normal file
View File

@@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询ip访问记录列表
export function listLoginLog(query) {
return request({
url: '/cai/loginLog/list',
method: 'get',
params: query
})
}

View File

@@ -0,0 +1,90 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="手机号" prop="mobile">
<el-input
v-model="queryParams.ipAddr"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<span style="color: red">请输入手机号可以查询单日的最近10条原始登录记录请勿一直查询查询比较慢</span>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ipRecordList" @selection-change="handleSelectionChange">
<el-table-column label="详情" align="left" prop="info" />
</el-table>
</div>
</template>
<script>
import {listLoginLog} from "@/api/cai/loginLog";
export default {
name: "IpRecord",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// ip访问记录表格数据
ipRecordList: [],
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
mobile: undefined,
},
};
},
created() {
this.getList();
},
methods: {
/** 查询ip访问记录列表 */
getList() {
this.loading = true;
listLoginLog(this.queryParams).then(response => {
this.ipRecordList = response.data;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
}
};
</script>