重新初始化admin后台
This commit is contained in:
parent
37439d9bde
commit
8d52d7e924
File diff suppressed because it is too large
Load Diff
|
|
@ -23,11 +23,7 @@ export default defineComponent({
|
|||
onMounted(async () => {
|
||||
// 获取配置
|
||||
const data = await store.dispatch('app/getConfig')
|
||||
|
||||
console.log(data, 'data.webFavicon')
|
||||
|
||||
// console.log(favicon, 'favicon')
|
||||
|
||||
console.log('data', data)
|
||||
// 设置网站logo
|
||||
let favicon: HTMLLinkElement = document.querySelector('link[rel="icon"]')!
|
||||
if (favicon) {
|
||||
|
|
|
|||
|
|
@ -2,28 +2,27 @@ import request from '@/utils/request'
|
|||
import { terminal } from '@/config/app'
|
||||
|
||||
export function adminLists(params: any) {
|
||||
return request.get('/admin/lists', { params })
|
||||
return request.get('/auth.admin/lists', { params })
|
||||
}
|
||||
|
||||
// 管理员添加
|
||||
export function apiAdminAdd(params: any) {
|
||||
return request.post('/admin/add', params)
|
||||
return request.post('/auth.admin/add', params)
|
||||
}
|
||||
|
||||
export function apiAdminEdit(params: any) {
|
||||
return request.post('/admin/edit', params)
|
||||
return request.post('/auth.admin/edit', params)
|
||||
}
|
||||
|
||||
// 管理员删除
|
||||
export function apiAdminDelete(params: { id: number }) {
|
||||
return request.post('/admin/del', params)
|
||||
return request.post('/auth.admin/delete', params)
|
||||
}
|
||||
|
||||
// 管理员详情
|
||||
export function apiAdminDetail(params: any) {
|
||||
return request.get('/admin/detail', { params })
|
||||
return request.get('/auth.admin/detail', { params })
|
||||
}
|
||||
|
||||
// 角色列表
|
||||
export function apiRoleLists(params: any) {
|
||||
return request.get('/auth.role/lists', { params })
|
||||
|
|
@ -51,6 +50,6 @@ export function apiConfigGetMenu() {
|
|||
}
|
||||
|
||||
// 角色权限
|
||||
// export function apiConfigGetAuth() {
|
||||
// return request.get('/config/getAuth')
|
||||
// }
|
||||
export function apiConfigGetAuth() {
|
||||
return request.get('/config/getAuth')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,3 +63,25 @@ export function apiLoginConfigSet(params: any) {
|
|||
return request.post('/setting.user.user/setRegisterConfig', params)
|
||||
}
|
||||
/** E 用户设置 **/
|
||||
|
||||
|
||||
|
||||
// 获取系统日志列表
|
||||
export function apiSystemLogLists(params: any) {
|
||||
return request.get('/setting.system.log/lists', { params })
|
||||
}
|
||||
|
||||
// 清除系统缓存
|
||||
export function apiSystemCacheClear() {
|
||||
return request.post('/setting.system.cache/clear')
|
||||
}
|
||||
|
||||
// 编辑管理员信息
|
||||
export function apiAuthAdminEditSelf(params: any) {
|
||||
return request.post('/auth.admin/editSelf', params)
|
||||
}
|
||||
|
||||
// 获取管理员信息
|
||||
export function apiAuthAdminMySelf() {
|
||||
return request.post('/auth.admin/mySelf')
|
||||
}
|
||||
|
|
@ -3,15 +3,15 @@ import { terminal } from '@/config/app'
|
|||
|
||||
// 登录
|
||||
export function apiLogin(params: { account: string; password: string }) {
|
||||
return request.post('/system/login', { ...params, terminal })
|
||||
return request.post('/login/account', { ...params, terminal })
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
export function apiLogout() {
|
||||
return request.post('/system/logout')
|
||||
return request.post('/login/logout')
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export function apiUserInfo() {
|
||||
return request.get('/system/admin/self')
|
||||
return request.get('/auth.admin/mySelf')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
<template>
|
||||
<el-date-picker
|
||||
v-model="content"
|
||||
type="datetimerange"
|
||||
:shortcuts="shortcuts"
|
||||
range-separator="-"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { withDefaults, computed } from 'vue'
|
||||
|
||||
/* Props S */
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
start_time?: string
|
||||
end_time?: string
|
||||
}>(),
|
||||
{
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
}
|
||||
)
|
||||
/* Props E */
|
||||
|
||||
/* Emit S */
|
||||
const emit = defineEmits(['update:start_time', 'update:end_time'])
|
||||
/* Emit E */
|
||||
|
||||
/* Computed S */
|
||||
let content = computed({
|
||||
get: () => {
|
||||
return [props.start_time, props.end_time]
|
||||
},
|
||||
set: (value: Event | any) => {
|
||||
if (value === null) {
|
||||
emit('update:start_time', '')
|
||||
emit('update:end_time', '')
|
||||
} else {
|
||||
emit('update:start_time', value[0])
|
||||
emit('update:end_time', value[1])
|
||||
}
|
||||
},
|
||||
})
|
||||
/* Computed E */
|
||||
|
||||
/* Data S */
|
||||
const shortcuts = [
|
||||
{
|
||||
text: '最近一个星期',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '最近一个月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '最近三个月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '未来一个星期',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(end.getTime() + 3600 * 1000 * 24 * 7)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '未来一个月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(end.getTime() + 3600 * 1000 * 24 * 30)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '未来三个月',
|
||||
value: () => {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(end.getTime() + 3600 * 1000 * 24 * 90)
|
||||
return [start, end]
|
||||
},
|
||||
},
|
||||
]
|
||||
/* Data E */
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
@ -21,10 +21,10 @@ export const asyncRoutes: Array<RouteRecordRaw> = [
|
|||
component: workbench,
|
||||
meta: { title: '工作台', icon: 'icon-home', permission: ['view'] }
|
||||
},
|
||||
decoration, // 装修管理
|
||||
application,// 应用管理
|
||||
content, // 内容管理
|
||||
channel, // 渠道管理
|
||||
// decoration, // 装修管理
|
||||
// application,// 应用管理
|
||||
// content, // 内容管理
|
||||
// channel, // 渠道管理
|
||||
permission,
|
||||
setting
|
||||
]
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ const routes: RouteRecordRaw = {
|
|||
path: '/setting/service',
|
||||
redirect: '/setting/service/online_service',
|
||||
component: RouterView,
|
||||
meta: { title: '客服设置' },
|
||||
meta: {
|
||||
title: '客服设置',
|
||||
hidden: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/setting/service/online_service',
|
||||
|
|
@ -49,6 +52,7 @@ const routes: RouteRecordRaw = {
|
|||
meta: {
|
||||
title: '政策/协议',
|
||||
permission: ['view'],
|
||||
hidden: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
@ -57,7 +61,10 @@ const routes: RouteRecordRaw = {
|
|||
path: '/setting/user',
|
||||
redirect: '/setting/user',
|
||||
component: RouterView,
|
||||
meta: { title: '用户设置' },
|
||||
meta: {
|
||||
title: '用户设置',
|
||||
hidden: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '/setting/user',
|
||||
|
|
@ -91,8 +98,33 @@ const routes: RouteRecordRaw = {
|
|||
permission: ['view'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/setting/website/journal',
|
||||
component: () => import('@/views/setting/system/journal.vue'),
|
||||
meta: {
|
||||
title: '系统日志',
|
||||
permission: ['view'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/setting/website/cache',
|
||||
component: () => import('@/views/setting/system/cache.vue'),
|
||||
meta: {
|
||||
title: '系统缓存',
|
||||
permission: ['view'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// component: RouterView,
|
||||
path: '/setting/personal/personal_data',
|
||||
component: () => import('@/views/setting/personal/personal_data.vue'),
|
||||
meta: {
|
||||
title: '个人设置',
|
||||
permission: ['view'],
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ const app: Module<AppModule, any> = {
|
|||
return new Promise((resolve, reject) => {
|
||||
apiConfig().then(data => {
|
||||
commit('setConfig', data)
|
||||
console.log(data, '==============================')
|
||||
|
||||
resolve(data)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@ const permission: Module<PermissionModule, any> = {
|
|||
actions: {
|
||||
getPermission({ commit }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// apiConfigGetAuth()
|
||||
// .then(data => {
|
||||
// commit('setPermission', data)
|
||||
// resolve(data)
|
||||
// })
|
||||
// .catch(err => {
|
||||
// reject(err)
|
||||
// })
|
||||
apiConfigGetAuth()
|
||||
.then(data => {
|
||||
commit('setPermission', data)
|
||||
resolve(data)
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// 引入所有样式
|
||||
@use 'element-plus/theme-chalk/src/index.scss';
|
||||
|
||||
// @use 'element-plus/theme-chalk/src/index.scss';
|
||||
@import "element-plus/theme-chalk/src/index.scss";
|
||||
:root {
|
||||
--el-font-weight-primary: 400;
|
||||
}
|
||||
|
|
@ -97,3 +97,8 @@
|
|||
.el-icon {
|
||||
font-size: var(--font-size);
|
||||
}
|
||||
|
||||
.el-alert--primary {
|
||||
color: $color-primary;
|
||||
background-color: $color-primary-light-9;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ request.interceptors.request.use(
|
|||
request.interceptors.response.use(
|
||||
response => {
|
||||
switch (response.data.code) {
|
||||
case 1:
|
||||
case 200:
|
||||
return eventResponse.success(response.data)
|
||||
case 0:
|
||||
case 300:
|
||||
return eventResponse.error(response.data)
|
||||
case -1:
|
||||
return eventResponse.redirect()
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
<div
|
||||
class="login-img"
|
||||
:style="{
|
||||
'background-image': `url(${config?.login_image})`
|
||||
'background-image': `url(${config.webBackdrop})`
|
||||
}"
|
||||
></div>
|
||||
<div class="login-form flex flex-col">
|
||||
<div class="f-s-24 f-w-500 text-center m-b-40">
|
||||
{{ config?.web_name }}
|
||||
{{ config.webName }}
|
||||
</div>
|
||||
<el-form ref="loginFormRefs" :model="loginForm" status-icon :rules="rules">
|
||||
<el-form-item prop="account">
|
||||
|
|
@ -49,9 +49,9 @@
|
|||
</div>
|
||||
<div class="login-footer">
|
||||
<div class="flex flex-center muted xs m-t-20">
|
||||
<span class="m-r-10">{{ config?.copyright_info }}</span>
|
||||
<a class="link muted" :href="config?.icp_link" target="_blank">{{
|
||||
config?.icp_number
|
||||
<span class="m-r-10">{{ config.copyright_info }}</span>
|
||||
<a class="link muted" :href="config.icp_link" target="_blank">{{
|
||||
config.icp_number
|
||||
}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,145 @@
|
|||
<!-- 个人资料 -->
|
||||
<template>
|
||||
<div class="personal-data">
|
||||
<el-card class="m-t-15" shadow="never">
|
||||
<el-form
|
||||
ref="formRefs"
|
||||
class="ls-form"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
label-width="150px"
|
||||
size="small"
|
||||
>
|
||||
<el-form-item label="头像:" prop="avatar">
|
||||
<material-select v-model="formData.avatar" :limit="1"></material-select>
|
||||
<!-- <div class="muted">建议尺寸:240*200,支持jpg、png格式</div> -->
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="账号:" prop="account">
|
||||
<el-input v-model="formData.account" placeholder="" disabled></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="名称:" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入名称"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="当前密码:" prop="password_old">
|
||||
<el-input v-model.trim="formData.password_old" placeholder="修改密码时必填, 不修改密码时留空" type="password" show-password></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="新的密码:" prop="password">
|
||||
<el-input v-model.trim="formData.password" placeholder="修改密码时必填, 不修改密码时留空" type="password" show-password></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="确定密码:" prop="password_confirm">
|
||||
<el-input v-model.trim="formData.password_confirm" placeholder="修改密码时必填, 不修改密码时留空" type="password" show-password></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<footer-btns>
|
||||
<el-button type="primary" size="small" @click="onSubmit(formRefs)">保存</el-button>
|
||||
</footer-btns>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import type { ElForm } from 'element-plus'
|
||||
import MaterialSelect from '@/components/material-select/index.vue'
|
||||
import FooterBtns from '@/components/footer-btns/index.vue'
|
||||
import { apiAuthAdminEditSelf, apiAuthAdminMySelf } from '@/api/setting'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useAdmin } from '@/core/hooks/app'
|
||||
|
||||
const { store } = useAdmin()
|
||||
type FormInstance = InstanceType<typeof ElForm>
|
||||
const formRefs = ref<FormInstance>()
|
||||
|
||||
// 表单数据
|
||||
const formData = ref({
|
||||
avatar: '', // 头像
|
||||
account: '', // 账号
|
||||
name: '', // 名称
|
||||
password_old: '', // 当前密码
|
||||
password: '', // 新的密码
|
||||
password_confirm: '', // 确定密码
|
||||
})
|
||||
|
||||
// 表单校验规则
|
||||
const rules = reactive<object>({
|
||||
avatar: [
|
||||
{
|
||||
required: true,
|
||||
message: '头像不能为空',
|
||||
trigger: ['change'],
|
||||
},
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入名称',
|
||||
trigger: ['blur'],
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
// 获取个人设置
|
||||
const getAuthAdminMySelf = async (): Promise<void> => {
|
||||
formData.value = await apiAuthAdminMySelf()
|
||||
}
|
||||
|
||||
// 设置个人设置
|
||||
const setAuthAdminEditSelf = async ():Promise<void> => {
|
||||
if(formData.value.password_old || formData.value.password || formData.value.password_confirm) {
|
||||
if(!formData.value.password_old) {
|
||||
return ElMessage({ type: 'error', message: '请输入当前密码' })
|
||||
}
|
||||
|
||||
if(!formData.value.password) {
|
||||
return ElMessage({ type: 'error', message: '请输入新的密码' })
|
||||
}
|
||||
|
||||
if(!formData.value.password_confirm) {
|
||||
return ElMessage({ type: 'error', message: '请输入确定密码' })
|
||||
}
|
||||
|
||||
if(formData.value.password_confirm != formData.value.password) {
|
||||
return ElMessage({ type: 'error', message: '两次输入的密码不一样' })
|
||||
}
|
||||
}
|
||||
|
||||
if(formData.value.password_old && formData.value.password && formData.value.password_confirm) {
|
||||
if(formData.value.password_old.length < 6 || formData.value.password_old.length > 32) {
|
||||
return ElMessage({ type: 'error', message: '密码长度在6到32之间' })
|
||||
}
|
||||
if(formData.value.password.length < 6 || formData.value.password.length > 32) {
|
||||
return ElMessage({ type: 'error', message: '密码长度在6到32之间' })
|
||||
}
|
||||
if(formData.value.password_confirm.length < 6 || formData.value.password_confirm.length > 32) {
|
||||
return ElMessage({ type: 'error', message: '密码长度在6到32之间' })
|
||||
}
|
||||
}
|
||||
|
||||
await apiAuthAdminEditSelf({...formData.value})
|
||||
getAuthAdminMySelf()
|
||||
store.dispatch('user/getUser')
|
||||
}
|
||||
|
||||
// 提交数据
|
||||
const onSubmit = (formEl: FormInstance | undefined): void => {
|
||||
if(!formEl) return
|
||||
|
||||
formEl.validate((valid): Boolean | undefined => {
|
||||
if(!valid) return false
|
||||
setAuthAdminEditSelf()
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getAuthAdminMySelf()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<!-- 系统缓存 -->
|
||||
<template>
|
||||
<div class="cache">
|
||||
<el-card shadow="never">
|
||||
<el-alert
|
||||
class="xxl"
|
||||
title="温馨提示:管理系统运行过程中产生的缓存"
|
||||
type="primary"
|
||||
:closable="false"
|
||||
show-icon
|
||||
>
|
||||
</el-alert>
|
||||
</el-card>
|
||||
|
||||
<el-card class="m-t-15" shadow="never">
|
||||
<div>
|
||||
<el-table class="m-t-20" :data="cacheDate">
|
||||
<el-table-column label="管理内容" prop="content"></el-table-column>
|
||||
<el-table-column label="内容说明" prop="desc"> </el-table-column>
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<popup class="m-r-10 inline" @confirm="handleClean" content="确定要清除系统缓存?">
|
||||
<template #trigger>
|
||||
<el-button type="text">清除系统缓存</el-button>
|
||||
</template>
|
||||
</popup>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
apiSystemCacheClear
|
||||
} from '@/api/setting'
|
||||
import { ref } from 'vue'
|
||||
import Popup from '@/components/Popup/index.vue'
|
||||
|
||||
// 列表数据
|
||||
let cacheDate = ref<Array<object>>([{
|
||||
content: '系统缓存',
|
||||
desc: '系统运行过程中产生的各类缓存数据',
|
||||
}])
|
||||
|
||||
// 清理缓存
|
||||
const handleClean = async () => {
|
||||
await apiSystemCacheClear()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<!-- 系统日志 -->
|
||||
<template>
|
||||
<div class="journal">
|
||||
<el-card shadow="never">
|
||||
<el-form class="ls-form" :model="formData" label-width="80px" size="small" inline>
|
||||
<el-form-item label="管理员">
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
class="ls-input"
|
||||
v-model="formData.admin_name"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="访问方式">
|
||||
<el-select v-model="formData.type" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, index) in visitType"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="来源IP">
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
class="ls-input"
|
||||
v-model="formData.ip"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="访问时间">
|
||||
<data-picker
|
||||
v-model:start_time="formData.start_time"
|
||||
v-model:end_time="formData.end_time"
|
||||
></data-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="访问链接">
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
class="ls-input"
|
||||
v-model="formData.url"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<div class="m-l-20">
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card class="m-t-15" shadow="never" v-loading="pager.loading">
|
||||
<div>
|
||||
<el-table class="m-t-20" :data="pager.lists">
|
||||
<el-table-column label="记录ID" prop="id"></el-table-column>
|
||||
<el-table-column label="操作" prop="action"></el-table-column>
|
||||
<el-table-column label="管理员" prop="admin_name"></el-table-column>
|
||||
<el-table-column label="管理员ID" prop="admin_id"> </el-table-column>
|
||||
<el-table-column label="访问链接" prop="url"></el-table-column>
|
||||
<el-table-column label="访问方式" prop="type"></el-table-column>
|
||||
<el-table-column label="访问参数" prop="params"> </el-table-column>
|
||||
<el-table-column label="来源IP" prop="ip"> </el-table-column>
|
||||
<el-table-column label="日志时间" prop="create_time"> </el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex row-right">
|
||||
<pagination
|
||||
v-model="pager"
|
||||
@change="requestApi"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
apiSystemLogLists
|
||||
} from '@/api/setting'
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import Pagination from '@/components/pagination/index.vue'
|
||||
import Popup from '@/components/Popup/index.vue'
|
||||
import { usePages } from '@/core/hooks/pages'
|
||||
import DataPicker from '@/components/data-picker/index.vue'
|
||||
|
||||
interface formDataObj {
|
||||
admin_name?: string // 管理员
|
||||
url?: string // 访问链接
|
||||
ip?: string // ip
|
||||
type?: string // 访问方式
|
||||
start_time?: string // 日志时间开始
|
||||
end_time?: string // 日志时间结束
|
||||
}
|
||||
|
||||
// 查询表单
|
||||
let formData = ref<formDataObj>({
|
||||
admin_name: '',
|
||||
url: '',
|
||||
ip: '',
|
||||
type: '',
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
})
|
||||
|
||||
// 访问方式
|
||||
const visitType = ref<Array<any>>([
|
||||
{
|
||||
label: '全部',
|
||||
value: '',
|
||||
},
|
||||
{
|
||||
label: 'get',
|
||||
value: 'get',
|
||||
},
|
||||
{
|
||||
label: 'post',
|
||||
value: 'post',
|
||||
},
|
||||
{
|
||||
label: 'put',
|
||||
value: 'put',
|
||||
},
|
||||
{
|
||||
label: 'delete',
|
||||
value: 'delete',
|
||||
},
|
||||
{
|
||||
label: 'option',
|
||||
value: 'option',
|
||||
},
|
||||
])
|
||||
|
||||
const { pager, requestApi, resetParams, resetPage } = usePages({
|
||||
callback: apiSystemLogLists,
|
||||
params: formData.value,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
requestApi()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
Loading…
Reference in New Issue