mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 13:04:57 +08:00
首页日志模块
This commit is contained in:
parent
68902cc8f1
commit
eb55210101
|
@ -1,6 +1,7 @@
|
||||||
import request, {CommonHeaderEnum} from "@/utils/request";
|
import request, {CommonHeaderEnum} from "@/utils/request";
|
||||||
|
|
||||||
const getMonthlyLogCountUrl = '/admin/log/getMonthlyLogCount'
|
const getMonthlyLogCountUrl = '/admin/log/getMonthlyLogCount'
|
||||||
|
const getPageUrl = "/admin/log/page";
|
||||||
|
|
||||||
export function getMonthlyLogCount(startTime: string, endTime: string) {
|
export function getMonthlyLogCount(startTime: string, endTime: string) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
@ -19,3 +20,13 @@ export function getMonthlyLogCount(startTime: string, endTime: string) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getPage(current: number, size: number) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
request.get(getPageUrl + `?current=${current}&size=${size}`).then((res: any) => {
|
||||||
|
resolve(res.data);
|
||||||
|
}).catch(err => {
|
||||||
|
reject(err);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
|
@ -1,22 +1,27 @@
|
||||||
<template>
|
<template>
|
||||||
<el-timeline>
|
<el-timeline>
|
||||||
<el-timeline-item v-for="(item, index) in activities" :key="index" :timestamp="item.time">
|
<el-timeline-item v-for="(item, index) in activities" :key="index" :timestamp="item.createTime">
|
||||||
{{ item.title + '-' + item.ip }}
|
{{ item.title + '-' + item.remoteAddr }}
|
||||||
</el-timeline-item>
|
</el-timeline-item>
|
||||||
</el-timeline>
|
</el-timeline>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup>
|
<script lang='ts' setup>
|
||||||
import { onMounted, reactive, ref, toRefs, watch } from 'vue'
|
import {onMounted, ref} from 'vue'
|
||||||
import { dateFormater } from '@/utils/date-util';
|
import * as logManageApi from "@/api/log-manage";
|
||||||
|
|
||||||
const activities: any = []
|
const activities = ref([] as any);
|
||||||
|
|
||||||
while (activities.length < 10) {
|
onMounted(function () {
|
||||||
activities.push({
|
getLogList();
|
||||||
time: dateFormater('yyyy-MM-dd HH:mm:ss'),
|
});
|
||||||
title: '登录成功',
|
|
||||||
ip: '127.0.0.1'
|
function getLogList() {
|
||||||
|
logManageApi.getPage(0, 100).then((res: any) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
activities.value = res.data.records;
|
||||||
|
console.log(activities.value)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user