feat(core): 初始化项目基础架构和CMS功能模块
- 添加Docker相关配置文件(.dockerignore, .env.example, .gitignore) - 实现服务端API代理功能,支持文件、模块和服务器API转发 - 创建文章详情页、栏目文章列表页和单页内容展示页面 - 集成Ant Design Vue组件库并实现SSR样式提取功能 - 定义API响应数据结构类型和应用布局组件 - 开发开发者应用中心和文章管理页面 - 实现CMS导航菜单获取和多租户切换功能
This commit is contained in:
32
app/api/system/login-record/index.ts
Normal file
32
app/api/system/login-record/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { LoginRecord, LoginRecordParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询登录日志
|
||||
*/
|
||||
export async function pageLoginRecords(params: LoginRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<LoginRecord>>>(
|
||||
SERVER_API_URL + '/system/login-record/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询登录日志列表
|
||||
*/
|
||||
export async function listLoginRecords(params?: LoginRecordParam) {
|
||||
const res = await request.get<ApiResult<LoginRecord[]>>(
|
||||
SERVER_API_URL + '/system/login-record',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
38
app/api/system/login-record/model/index.ts
Normal file
38
app/api/system/login-record/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 登录日志
|
||||
*/
|
||||
export interface LoginRecord {
|
||||
// 登录日志id
|
||||
id: number;
|
||||
// 用户账号
|
||||
username: string;
|
||||
// 操作系统
|
||||
os: string;
|
||||
// 设备名称
|
||||
device: string;
|
||||
// 浏览器类型
|
||||
browser: string;
|
||||
// ip地址
|
||||
ip: string;
|
||||
// 操作类型, 0登录成功, 1登录失败, 2退出登录, 3续签token
|
||||
loginType: number;
|
||||
// 备注
|
||||
comments: string;
|
||||
// 操作时间
|
||||
createTime: string;
|
||||
// 用户昵称
|
||||
nickname: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录日志搜索条件
|
||||
*/
|
||||
export interface LoginRecordParam extends PageParam {
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
loginType?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user