mirror of
https://gitee.com/yudaocode/yudao-ui-admin-vben.git
synced 2025-12-30 10:32:25 +00:00
feat: system api
This commit is contained in:
24
apps/web-tdesign/src/api/system/area/index.ts
Normal file
24
apps/web-tdesign/src/api/system/area/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemAreaApi {
|
||||
/** 地区信息 */
|
||||
export interface Area {
|
||||
id?: number;
|
||||
name: string;
|
||||
code: string;
|
||||
parentId?: number;
|
||||
sort?: number;
|
||||
status?: number;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得地区树 */
|
||||
export function getAreaTree() {
|
||||
return requestClient.get<SystemAreaApi.Area[]>('/system/area/tree');
|
||||
}
|
||||
|
||||
/** 获得 IP 对应的地区名 */
|
||||
export function getAreaByIp(ip: string) {
|
||||
return requestClient.get<string>(`/system/area/get-by-ip?ip=${ip}`);
|
||||
}
|
||||
52
apps/web-tdesign/src/api/system/dept/index.ts
Normal file
52
apps/web-tdesign/src/api/system/dept/index.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemDeptApi {
|
||||
/** 部门信息 */
|
||||
export interface Dept {
|
||||
id?: number;
|
||||
name: string;
|
||||
parentId?: number;
|
||||
status: number;
|
||||
sort: number;
|
||||
leaderUserId: number;
|
||||
phone: string;
|
||||
email: string;
|
||||
createTime: Date;
|
||||
children?: Dept[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询部门(精简)列表 */
|
||||
export async function getSimpleDeptList() {
|
||||
return requestClient.get<SystemDeptApi.Dept[]>('/system/dept/simple-list');
|
||||
}
|
||||
|
||||
/** 查询部门列表 */
|
||||
export async function getDeptList() {
|
||||
return requestClient.get('/system/dept/list');
|
||||
}
|
||||
|
||||
/** 查询部门详情 */
|
||||
export async function getDept(id: number) {
|
||||
return requestClient.get<SystemDeptApi.Dept>(`/system/dept/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增部门 */
|
||||
export async function createDept(data: SystemDeptApi.Dept) {
|
||||
return requestClient.post('/system/dept/create', data);
|
||||
}
|
||||
|
||||
/** 修改部门 */
|
||||
export async function updateDept(data: SystemDeptApi.Dept) {
|
||||
return requestClient.put('/system/dept/update', data);
|
||||
}
|
||||
|
||||
/** 删除部门 */
|
||||
export async function deleteDept(id: number) {
|
||||
return requestClient.delete(`/system/dept/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除部门 */
|
||||
export async function deleteDeptList(ids: number[]) {
|
||||
return requestClient.delete(`/system/dept/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
68
apps/web-tdesign/src/api/system/dict/data/index.ts
Normal file
68
apps/web-tdesign/src/api/system/dict/data/index.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemDictDataApi {
|
||||
/** 字典数据 */
|
||||
export type DictData = {
|
||||
colorType: string;
|
||||
createTime: Date;
|
||||
cssClass: string;
|
||||
dictType: string;
|
||||
id?: number;
|
||||
label: string;
|
||||
remark: string;
|
||||
sort?: number;
|
||||
status: number;
|
||||
value: string;
|
||||
};
|
||||
}
|
||||
|
||||
// 查询字典数据(精简)列表
|
||||
export function getSimpleDictDataList() {
|
||||
return requestClient.get<SystemDictDataApi.DictData[]>(
|
||||
'/system/dict-data/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
// 查询字典数据列表
|
||||
export function getDictDataPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemDictDataApi.DictData>>(
|
||||
'/system/dict-data/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 查询字典数据详情
|
||||
export function getDictData(id: number) {
|
||||
return requestClient.get<SystemDictDataApi.DictData>(
|
||||
`/system/dict-data/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 新增字典数据
|
||||
export function createDictData(data: SystemDictDataApi.DictData) {
|
||||
return requestClient.post('/system/dict-data/create', data);
|
||||
}
|
||||
|
||||
// 修改字典数据
|
||||
export function updateDictData(data: SystemDictDataApi.DictData) {
|
||||
return requestClient.put('/system/dict-data/update', data);
|
||||
}
|
||||
|
||||
// 删除字典数据
|
||||
export function deleteDictData(id: number) {
|
||||
return requestClient.delete(`/system/dict-data/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 批量删除字典数据
|
||||
export function deleteDictDataList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/dict-data/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 导出字典类型数据
|
||||
export function exportDictData(params: any) {
|
||||
return requestClient.download('/system/dict-data/export-excel', { params });
|
||||
}
|
||||
64
apps/web-tdesign/src/api/system/dict/type/index.ts
Normal file
64
apps/web-tdesign/src/api/system/dict/type/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemDictTypeApi {
|
||||
/** 字典类型 */
|
||||
export type DictType = {
|
||||
createTime: Date;
|
||||
id?: number;
|
||||
name: string;
|
||||
remark: string;
|
||||
status: number;
|
||||
type: string;
|
||||
};
|
||||
}
|
||||
|
||||
// 查询字典(精简)列表
|
||||
export function getSimpleDictTypeList() {
|
||||
return requestClient.get<SystemDictTypeApi.DictType[]>(
|
||||
'/system/dict-type/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
// 查询字典列表
|
||||
export function getDictTypePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemDictTypeApi.DictType>>(
|
||||
'/system/dict-type/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// 查询字典详情
|
||||
export function getDictType(id: number) {
|
||||
return requestClient.get<SystemDictTypeApi.DictType>(
|
||||
`/system/dict-type/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 新增字典
|
||||
export function createDictType(data: SystemDictTypeApi.DictType) {
|
||||
return requestClient.post('/system/dict-type/create', data);
|
||||
}
|
||||
|
||||
// 修改字典
|
||||
export function updateDictType(data: SystemDictTypeApi.DictType) {
|
||||
return requestClient.put('/system/dict-type/update', data);
|
||||
}
|
||||
|
||||
// 删除字典
|
||||
export function deleteDictType(id: number) {
|
||||
return requestClient.delete(`/system/dict-type/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 批量删除字典
|
||||
export function deleteDictTypeList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/dict-type/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 导出字典类型
|
||||
export function exportDictType(params: any) {
|
||||
return requestClient.download('/system/dict-type/export-excel', { params });
|
||||
}
|
||||
33
apps/web-tdesign/src/api/system/login-log/index.ts
Normal file
33
apps/web-tdesign/src/api/system/login-log/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemLoginLogApi {
|
||||
/** 登录日志信息 */
|
||||
export interface LoginLog {
|
||||
id: number;
|
||||
logType: number;
|
||||
traceId: number;
|
||||
userId: number;
|
||||
userType: number;
|
||||
username: string;
|
||||
result: number;
|
||||
status: number;
|
||||
userIp: string;
|
||||
userAgent: string;
|
||||
createTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询登录日志列表 */
|
||||
export function getLoginLogPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemLoginLogApi.LoginLog>>(
|
||||
'/system/login-log/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出登录日志 */
|
||||
export function exportLoginLog(params: any) {
|
||||
return requestClient.download('/system/login-log/export-excel', { params });
|
||||
}
|
||||
64
apps/web-tdesign/src/api/system/mail/account/index.ts
Normal file
64
apps/web-tdesign/src/api/system/mail/account/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemMailAccountApi {
|
||||
/** 邮箱账号 */
|
||||
export interface MailAccount {
|
||||
id: number;
|
||||
mail: string;
|
||||
username: string;
|
||||
password: string;
|
||||
host: string;
|
||||
port: number;
|
||||
sslEnable: boolean;
|
||||
starttlsEnable: boolean;
|
||||
status: number;
|
||||
createTime: Date;
|
||||
remark: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询邮箱账号列表 */
|
||||
export function getMailAccountPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemMailAccountApi.MailAccount>>(
|
||||
'/system/mail-account/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询邮箱账号详情 */
|
||||
export function getMailAccount(id: number) {
|
||||
return requestClient.get<SystemMailAccountApi.MailAccount>(
|
||||
`/system/mail-account/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增邮箱账号 */
|
||||
export function createMailAccount(data: SystemMailAccountApi.MailAccount) {
|
||||
return requestClient.post('/system/mail-account/create', data);
|
||||
}
|
||||
|
||||
/** 修改邮箱账号 */
|
||||
export function updateMailAccount(data: SystemMailAccountApi.MailAccount) {
|
||||
return requestClient.put('/system/mail-account/update', data);
|
||||
}
|
||||
|
||||
/** 删除邮箱账号 */
|
||||
export function deleteMailAccount(id: number) {
|
||||
return requestClient.delete(`/system/mail-account/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除邮箱账号 */
|
||||
export function deleteMailAccountList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/mail-account/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得邮箱账号精简列表 */
|
||||
export function getSimpleMailAccountList() {
|
||||
return requestClient.get<SystemMailAccountApi.MailAccount[]>(
|
||||
'/system/mail-account/simple-list',
|
||||
);
|
||||
}
|
||||
36
apps/web-tdesign/src/api/system/mail/log/index.ts
Normal file
36
apps/web-tdesign/src/api/system/mail/log/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemMailLogApi {
|
||||
/** 邮件日志 */
|
||||
export interface MailLog {
|
||||
id: number;
|
||||
userId: number;
|
||||
userType: number;
|
||||
toMails: string[];
|
||||
ccMails?: string[];
|
||||
bccMails?: string[];
|
||||
accountId: number;
|
||||
fromMail: string;
|
||||
templateId: number;
|
||||
templateCode: string;
|
||||
templateNickname: string;
|
||||
templateTitle: string;
|
||||
templateContent: string;
|
||||
templateParams: string;
|
||||
sendStatus: number;
|
||||
sendTime: string;
|
||||
sendMessageId: string;
|
||||
sendException: string;
|
||||
createTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询邮件日志列表 */
|
||||
export function getMailLogPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemMailLogApi.MailLog>>(
|
||||
'/system/mail-log/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
71
apps/web-tdesign/src/api/system/mail/template/index.ts
Normal file
71
apps/web-tdesign/src/api/system/mail/template/index.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemMailTemplateApi {
|
||||
/** 邮件模版信息 */
|
||||
export interface MailTemplate {
|
||||
id: number;
|
||||
name: string;
|
||||
code: string;
|
||||
accountId: number;
|
||||
nickname: string;
|
||||
title: string;
|
||||
content: string;
|
||||
params: string[];
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime: Date;
|
||||
}
|
||||
|
||||
/** 邮件发送信息 */
|
||||
export interface MailSendReqVO {
|
||||
toMails: string[];
|
||||
ccMails?: string[];
|
||||
bccMails?: string[];
|
||||
templateCode: string;
|
||||
templateParams: Record<string, any>;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询邮件模版列表 */
|
||||
export function getMailTemplatePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemMailTemplateApi.MailTemplate>>(
|
||||
'/system/mail-template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询邮件模版详情 */
|
||||
export function getMailTemplate(id: number) {
|
||||
return requestClient.get<SystemMailTemplateApi.MailTemplate>(
|
||||
`/system/mail-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增邮件模版 */
|
||||
export function createMailTemplate(data: SystemMailTemplateApi.MailTemplate) {
|
||||
return requestClient.post('/system/mail-template/create', data);
|
||||
}
|
||||
|
||||
/** 修改邮件模版 */
|
||||
export function updateMailTemplate(data: SystemMailTemplateApi.MailTemplate) {
|
||||
return requestClient.put('/system/mail-template/update', data);
|
||||
}
|
||||
|
||||
/** 删除邮件模版 */
|
||||
export function deleteMailTemplate(id: number) {
|
||||
return requestClient.delete(`/system/mail-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除邮件模版 */
|
||||
export function deleteMailTemplateList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/mail-template/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 发送邮件 */
|
||||
export function sendMail(data: SystemMailTemplateApi.MailSendReqVO) {
|
||||
return requestClient.post('/system/mail-template/send-mail', data);
|
||||
}
|
||||
59
apps/web-tdesign/src/api/system/menu/index.ts
Normal file
59
apps/web-tdesign/src/api/system/menu/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemMenuApi {
|
||||
/** 菜单信息 */
|
||||
export interface Menu {
|
||||
id: number;
|
||||
name: string;
|
||||
permission: string;
|
||||
type: number;
|
||||
sort: number;
|
||||
parentId: number;
|
||||
path: string;
|
||||
icon: string;
|
||||
component: string;
|
||||
componentName?: string;
|
||||
status: number;
|
||||
visible: boolean;
|
||||
keepAlive: boolean;
|
||||
alwaysShow?: boolean;
|
||||
createTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询菜单(精简)列表 */
|
||||
export async function getSimpleMenusList() {
|
||||
return requestClient.get<SystemMenuApi.Menu[]>('/system/menu/simple-list');
|
||||
}
|
||||
|
||||
/** 查询菜单列表 */
|
||||
export async function getMenuList(params?: Record<string, any>) {
|
||||
return requestClient.get<SystemMenuApi.Menu[]>('/system/menu/list', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取菜单详情 */
|
||||
export async function getMenu(id: number) {
|
||||
return requestClient.get<SystemMenuApi.Menu>(`/system/menu/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增菜单 */
|
||||
export async function createMenu(data: SystemMenuApi.Menu) {
|
||||
return requestClient.post('/system/menu/create', data);
|
||||
}
|
||||
|
||||
/** 修改菜单 */
|
||||
export async function updateMenu(data: SystemMenuApi.Menu) {
|
||||
return requestClient.put('/system/menu/update', data);
|
||||
}
|
||||
|
||||
/** 删除菜单 */
|
||||
export async function deleteMenu(id: number) {
|
||||
return requestClient.delete(`/system/menu/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除菜单 */
|
||||
export async function deleteMenuList(ids: number[]) {
|
||||
return requestClient.delete(`/system/menu/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
59
apps/web-tdesign/src/api/system/notice/index.ts
Normal file
59
apps/web-tdesign/src/api/system/notice/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemNoticeApi {
|
||||
/** 公告信息 */
|
||||
export interface Notice {
|
||||
id?: number;
|
||||
title: string;
|
||||
type: number;
|
||||
content: string;
|
||||
status: number;
|
||||
remark: string;
|
||||
creator?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询公告列表 */
|
||||
export function getNoticePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemNoticeApi.Notice>>(
|
||||
'/system/notice/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询公告详情 */
|
||||
export function getNotice(id: number) {
|
||||
return requestClient.get<SystemNoticeApi.Notice>(
|
||||
`/system/notice/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增公告 */
|
||||
export function createNotice(data: SystemNoticeApi.Notice) {
|
||||
return requestClient.post('/system/notice/create', data);
|
||||
}
|
||||
|
||||
/** 修改公告 */
|
||||
export function updateNotice(data: SystemNoticeApi.Notice) {
|
||||
return requestClient.put('/system/notice/update', data);
|
||||
}
|
||||
|
||||
/** 删除公告 */
|
||||
export function deleteNotice(id: number) {
|
||||
return requestClient.delete(`/system/notice/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除公告 */
|
||||
export function deleteNoticeList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/notice/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 推送公告 */
|
||||
export function pushNotice(id: number) {
|
||||
return requestClient.post(`/system/notice/push?id=${id}`);
|
||||
}
|
||||
65
apps/web-tdesign/src/api/system/notify/message/index.ts
Normal file
65
apps/web-tdesign/src/api/system/notify/message/index.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemNotifyMessageApi {
|
||||
/** 站内信消息信息 */
|
||||
export interface NotifyMessage {
|
||||
id: number;
|
||||
userId: number;
|
||||
userType: number;
|
||||
templateId: number;
|
||||
templateCode: string;
|
||||
templateNickname: string;
|
||||
templateContent: string;
|
||||
templateType: number;
|
||||
templateParams: string;
|
||||
readStatus: boolean;
|
||||
readTime: Date;
|
||||
createTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询站内信消息列表 */
|
||||
export function getNotifyMessagePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemNotifyMessageApi.NotifyMessage>>(
|
||||
'/system/notify-message/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得我的站内信分页 */
|
||||
export function getMyNotifyMessagePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemNotifyMessageApi.NotifyMessage>>(
|
||||
'/system/notify-message/my-page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 批量标记已读 */
|
||||
export function updateNotifyMessageRead(ids: number[]) {
|
||||
return requestClient.put(
|
||||
'/system/notify-message/update-read',
|
||||
{},
|
||||
{
|
||||
params: { ids },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 标记所有站内信为已读 */
|
||||
export function updateAllNotifyMessageRead() {
|
||||
return requestClient.put('/system/notify-message/update-all-read');
|
||||
}
|
||||
|
||||
/** 获取当前用户的最新站内信列表 */
|
||||
export function getUnreadNotifyMessageList() {
|
||||
return requestClient.get<SystemNotifyMessageApi.NotifyMessage[]>(
|
||||
'/system/notify-message/get-unread-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得当前用户的未读站内信数量 */
|
||||
export function getUnreadNotifyMessageCount() {
|
||||
return requestClient.get<number>('/system/notify-message/get-unread-count');
|
||||
}
|
||||
79
apps/web-tdesign/src/api/system/notify/template/index.ts
Normal file
79
apps/web-tdesign/src/api/system/notify/template/index.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemNotifyTemplateApi {
|
||||
/** 站内信模板信息 */
|
||||
export interface NotifyTemplate {
|
||||
id?: number;
|
||||
name: string;
|
||||
nickname: string;
|
||||
code: string;
|
||||
content: string;
|
||||
type?: number;
|
||||
params: string[];
|
||||
status: number;
|
||||
remark: string;
|
||||
}
|
||||
|
||||
/** 发送站内信请求 */
|
||||
export interface NotifySendReqVO {
|
||||
userId: number;
|
||||
userType: number;
|
||||
templateCode: string;
|
||||
templateParams: Record<string, any>;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询站内信模板列表 */
|
||||
export function getNotifyTemplatePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemNotifyTemplateApi.NotifyTemplate>>(
|
||||
'/system/notify-template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询站内信模板详情 */
|
||||
export function getNotifyTemplate(id: number) {
|
||||
return requestClient.get<SystemNotifyTemplateApi.NotifyTemplate>(
|
||||
`/system/notify-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增站内信模板 */
|
||||
export function createNotifyTemplate(
|
||||
data: SystemNotifyTemplateApi.NotifyTemplate,
|
||||
) {
|
||||
return requestClient.post('/system/notify-template/create', data);
|
||||
}
|
||||
|
||||
/** 修改站内信模板 */
|
||||
export function updateNotifyTemplate(
|
||||
data: SystemNotifyTemplateApi.NotifyTemplate,
|
||||
) {
|
||||
return requestClient.put('/system/notify-template/update', data);
|
||||
}
|
||||
|
||||
/** 删除站内信模板 */
|
||||
export function deleteNotifyTemplate(id: number) {
|
||||
return requestClient.delete(`/system/notify-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除站内信模板 */
|
||||
export function deleteNotifyTemplateList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/notify-template/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出站内信模板 */
|
||||
export function exportNotifyTemplate(params: any) {
|
||||
return requestClient.download('/system/notify-template/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 发送站内信 */
|
||||
export function sendNotify(data: SystemNotifyTemplateApi.NotifySendReqVO) {
|
||||
return requestClient.post('/system/notify-template/send-notify', data);
|
||||
}
|
||||
64
apps/web-tdesign/src/api/system/oauth2/client/index.ts
Normal file
64
apps/web-tdesign/src/api/system/oauth2/client/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemOAuth2ClientApi {
|
||||
/** OAuth2.0 客户端信息 */
|
||||
export interface OAuth2Client {
|
||||
id?: number;
|
||||
clientId: string;
|
||||
secret: string;
|
||||
name: string;
|
||||
logo: string;
|
||||
description: string;
|
||||
status: number;
|
||||
accessTokenValiditySeconds: number;
|
||||
refreshTokenValiditySeconds: number;
|
||||
redirectUris: string[];
|
||||
autoApprove: boolean;
|
||||
authorizedGrantTypes: string[];
|
||||
scopes: string[];
|
||||
authorities: string[];
|
||||
resourceIds: string[];
|
||||
additionalInformation: string;
|
||||
isAdditionalInformationJson: boolean;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询 OAuth2.0 客户端列表 */
|
||||
export function getOAuth2ClientPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemOAuth2ClientApi.OAuth2Client>>(
|
||||
'/system/oauth2-client/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询 OAuth2.0 客户端详情 */
|
||||
export function getOAuth2Client(id: number) {
|
||||
return requestClient.get<SystemOAuth2ClientApi.OAuth2Client>(
|
||||
`/system/oauth2-client/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增 OAuth2.0 客户端 */
|
||||
export function createOAuth2Client(data: SystemOAuth2ClientApi.OAuth2Client) {
|
||||
return requestClient.post('/system/oauth2-client/create', data);
|
||||
}
|
||||
|
||||
/** 修改 OAuth2.0 客户端 */
|
||||
export function updateOAuth2Client(data: SystemOAuth2ClientApi.OAuth2Client) {
|
||||
return requestClient.put('/system/oauth2-client/update', data);
|
||||
}
|
||||
|
||||
/** 删除 OAuth2.0 客户端 */
|
||||
export function deleteOAuth2Client(id: number) {
|
||||
return requestClient.delete(`/system/oauth2-client/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除 OAuth2.0 客户端 */
|
||||
export function deleteOAuth2ClientList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/oauth2-client/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
58
apps/web-tdesign/src/api/system/oauth2/open/index.ts
Normal file
58
apps/web-tdesign/src/api/system/oauth2/open/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** OAuth2.0 授权信息响应 */
|
||||
export namespace SystemOAuth2ClientApi {
|
||||
/** 授权信息 */
|
||||
export interface AuthorizeInfoRespVO {
|
||||
client: {
|
||||
logo: string;
|
||||
name: string;
|
||||
};
|
||||
scopes: {
|
||||
key: string;
|
||||
value: boolean;
|
||||
}[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得授权信息 */
|
||||
export function getAuthorize(clientId: string) {
|
||||
return requestClient.get<SystemOAuth2ClientApi.AuthorizeInfoRespVO>(
|
||||
`/system/oauth2/authorize?clientId=${clientId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 发起授权 */
|
||||
export function authorize(
|
||||
responseType: string,
|
||||
clientId: string,
|
||||
redirectUri: string,
|
||||
state: string,
|
||||
autoApprove: boolean,
|
||||
checkedScopes: string[],
|
||||
uncheckedScopes: string[],
|
||||
) {
|
||||
// 构建 scopes
|
||||
const scopes: Record<string, boolean> = {};
|
||||
for (const scope of checkedScopes) {
|
||||
scopes[scope] = true;
|
||||
}
|
||||
for (const scope of uncheckedScopes) {
|
||||
scopes[scope] = false;
|
||||
}
|
||||
|
||||
// 发起请求
|
||||
return requestClient.post<string>('/system/oauth2/authorize', null, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
params: {
|
||||
response_type: responseType,
|
||||
client_id: clientId,
|
||||
redirect_uri: redirectUri,
|
||||
state,
|
||||
auto_approve: autoApprove,
|
||||
scope: JSON.stringify(scopes),
|
||||
},
|
||||
});
|
||||
}
|
||||
34
apps/web-tdesign/src/api/system/oauth2/token/index.ts
Normal file
34
apps/web-tdesign/src/api/system/oauth2/token/index.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemOAuth2TokenApi {
|
||||
/** OAuth2.0 令牌信息 */
|
||||
export interface OAuth2Token {
|
||||
id?: number;
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
userId: number;
|
||||
userType: number;
|
||||
clientId: string;
|
||||
createTime?: Date;
|
||||
expiresTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询 OAuth2.0 令牌列表 */
|
||||
export function getOAuth2TokenPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemOAuth2TokenApi.OAuth2Token>>(
|
||||
'/system/oauth2-token/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除 OAuth2.0 令牌 */
|
||||
export function deleteOAuth2Token(accessToken: string) {
|
||||
return requestClient.delete(
|
||||
`/system/oauth2-token/delete?accessToken=${accessToken}`,
|
||||
);
|
||||
}
|
||||
39
apps/web-tdesign/src/api/system/operate-log/index.ts
Normal file
39
apps/web-tdesign/src/api/system/operate-log/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemOperateLogApi {
|
||||
/** 操作日志信息 */
|
||||
export interface OperateLog {
|
||||
id: number;
|
||||
traceId: string;
|
||||
userType: number;
|
||||
userId: number;
|
||||
userName: string;
|
||||
type: string;
|
||||
subType: string;
|
||||
bizId: number;
|
||||
action: string;
|
||||
extra: string;
|
||||
requestMethod: string;
|
||||
requestUrl: string;
|
||||
userIp: string;
|
||||
userAgent: string;
|
||||
creator: string;
|
||||
creatorName: string;
|
||||
createTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询操作日志列表 */
|
||||
export function getOperateLogPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemOperateLogApi.OperateLog>>(
|
||||
'/system/operate-log/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出操作日志 */
|
||||
export function exportOperateLog(params: any) {
|
||||
return requestClient.download('/system/operate-log/export-excel', { params });
|
||||
}
|
||||
57
apps/web-tdesign/src/api/system/permission/index.ts
Normal file
57
apps/web-tdesign/src/api/system/permission/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemPermissionApi {
|
||||
/** 分配用户角色请求 */
|
||||
export interface AssignUserRoleReqVO {
|
||||
userId: number;
|
||||
roleIds: number[];
|
||||
}
|
||||
|
||||
/** 分配角色菜单请求 */
|
||||
export interface AssignRoleMenuReqVO {
|
||||
roleId: number;
|
||||
menuIds: number[];
|
||||
}
|
||||
|
||||
/** 分配角色数据权限请求 */
|
||||
export interface AssignRoleDataScopeReqVO {
|
||||
roleId: number;
|
||||
dataScope: number;
|
||||
dataScopeDeptIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询角色拥有的菜单权限 */
|
||||
export async function getRoleMenuList(roleId: number) {
|
||||
return requestClient.get(
|
||||
`/system/permission/list-role-menus?roleId=${roleId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 赋予角色菜单权限 */
|
||||
export async function assignRoleMenu(
|
||||
data: SystemPermissionApi.AssignRoleMenuReqVO,
|
||||
) {
|
||||
return requestClient.post('/system/permission/assign-role-menu', data);
|
||||
}
|
||||
|
||||
/** 赋予角色数据权限 */
|
||||
export async function assignRoleDataScope(
|
||||
data: SystemPermissionApi.AssignRoleDataScopeReqVO,
|
||||
) {
|
||||
return requestClient.post('/system/permission/assign-role-data-scope', data);
|
||||
}
|
||||
|
||||
/** 查询用户拥有的角色数组 */
|
||||
export async function getUserRoleList(userId: number) {
|
||||
return requestClient.get(
|
||||
`/system/permission/list-user-roles?userId=${userId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 赋予用户角色 */
|
||||
export async function assignUserRole(
|
||||
data: SystemPermissionApi.AssignUserRoleReqVO,
|
||||
) {
|
||||
return requestClient.post('/system/permission/assign-user-role', data);
|
||||
}
|
||||
63
apps/web-tdesign/src/api/system/post/index.ts
Normal file
63
apps/web-tdesign/src/api/system/post/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemPostApi {
|
||||
/** 岗位信息 */
|
||||
export interface Post {
|
||||
id?: number;
|
||||
name: string;
|
||||
code: string;
|
||||
sort: number;
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询岗位列表 */
|
||||
export function getPostPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemPostApi.Post>>(
|
||||
'/system/post/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取岗位精简信息列表 */
|
||||
export function getSimplePostList() {
|
||||
return requestClient.get<SystemPostApi.Post[]>('/system/post/simple-list');
|
||||
}
|
||||
|
||||
/** 查询岗位详情 */
|
||||
export function getPost(id: number) {
|
||||
return requestClient.get<SystemPostApi.Post>(`/system/post/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增岗位 */
|
||||
export function createPost(data: SystemPostApi.Post) {
|
||||
return requestClient.post('/system/post/create', data);
|
||||
}
|
||||
|
||||
/** 修改岗位 */
|
||||
export function updatePost(data: SystemPostApi.Post) {
|
||||
return requestClient.put('/system/post/update', data);
|
||||
}
|
||||
|
||||
/** 删除岗位 */
|
||||
export function deletePost(id: number) {
|
||||
return requestClient.delete(`/system/post/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除岗位 */
|
||||
export function deletePostList(ids: number[]) {
|
||||
return requestClient.delete(`/system/post/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出岗位 */
|
||||
export function exportPost(params: any) {
|
||||
return requestClient.download('/system/post/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
63
apps/web-tdesign/src/api/system/role/index.ts
Normal file
63
apps/web-tdesign/src/api/system/role/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemRoleApi {
|
||||
/** 角色信息 */
|
||||
export interface Role {
|
||||
id?: number;
|
||||
name: string;
|
||||
code: string;
|
||||
sort: number;
|
||||
status: number;
|
||||
type: number;
|
||||
dataScope: number;
|
||||
dataScopeDeptIds: number[];
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询角色列表 */
|
||||
export function getRolePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemRoleApi.Role>>(
|
||||
'/system/role/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询角色(精简)列表 */
|
||||
export function getSimpleRoleList() {
|
||||
return requestClient.get<SystemRoleApi.Role[]>('/system/role/simple-list');
|
||||
}
|
||||
|
||||
/** 查询角色详情 */
|
||||
export function getRole(id: number) {
|
||||
return requestClient.get<SystemRoleApi.Role>(`/system/role/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增角色 */
|
||||
export function createRole(data: SystemRoleApi.Role) {
|
||||
return requestClient.post('/system/role/create', data);
|
||||
}
|
||||
|
||||
/** 修改角色 */
|
||||
export function updateRole(data: SystemRoleApi.Role) {
|
||||
return requestClient.put('/system/role/update', data);
|
||||
}
|
||||
|
||||
/** 删除角色 */
|
||||
export function deleteRole(id: number) {
|
||||
return requestClient.delete(`/system/role/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除角色 */
|
||||
export function deleteRoleList(ids: number[]) {
|
||||
return requestClient.delete(`/system/role/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出角色 */
|
||||
export function exportRole(params: any) {
|
||||
return requestClient.download('/system/role/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
67
apps/web-tdesign/src/api/system/sms/channel/index.ts
Normal file
67
apps/web-tdesign/src/api/system/sms/channel/index.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemSmsChannelApi {
|
||||
/** 短信渠道信息 */
|
||||
export interface SmsChannel {
|
||||
id?: number;
|
||||
code: string;
|
||||
status: number;
|
||||
signature: string;
|
||||
remark: string;
|
||||
apiKey: string;
|
||||
apiSecret: string;
|
||||
callbackUrl: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询短信渠道列表 */
|
||||
export function getSmsChannelPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemSmsChannelApi.SmsChannel>>(
|
||||
'/system/sms-channel/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得短信渠道精简列表 */
|
||||
export function getSimpleSmsChannelList() {
|
||||
return requestClient.get<SystemSmsChannelApi.SmsChannel[]>(
|
||||
'/system/sms-channel/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询短信渠道详情 */
|
||||
export function getSmsChannel(id: number) {
|
||||
return requestClient.get<SystemSmsChannelApi.SmsChannel>(
|
||||
`/system/sms-channel/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增短信渠道 */
|
||||
export function createSmsChannel(data: SystemSmsChannelApi.SmsChannel) {
|
||||
return requestClient.post('/system/sms-channel/create', data);
|
||||
}
|
||||
|
||||
/** 修改短信渠道 */
|
||||
export function updateSmsChannel(data: SystemSmsChannelApi.SmsChannel) {
|
||||
return requestClient.put('/system/sms-channel/update', data);
|
||||
}
|
||||
|
||||
/** 删除短信渠道 */
|
||||
export function deleteSmsChannel(id: number) {
|
||||
return requestClient.delete(`/system/sms-channel/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除短信渠道 */
|
||||
export function deleteSmsChannelList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/sms-channel/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出短信渠道 */
|
||||
export function exportSmsChannel(params: any) {
|
||||
return requestClient.download('/system/sms-channel/export-excel', { params });
|
||||
}
|
||||
45
apps/web-tdesign/src/api/system/sms/log/index.ts
Normal file
45
apps/web-tdesign/src/api/system/sms/log/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemSmsLogApi {
|
||||
/** 短信日志信息 */
|
||||
export interface SmsLog {
|
||||
id?: number;
|
||||
channelId?: number;
|
||||
channelCode: string;
|
||||
templateId?: number;
|
||||
templateCode: string;
|
||||
templateType?: number;
|
||||
templateContent: string;
|
||||
templateParams?: Record<string, any>;
|
||||
apiTemplateId: string;
|
||||
mobile: string;
|
||||
userId?: number;
|
||||
userType?: number;
|
||||
sendStatus?: number;
|
||||
sendTime?: string;
|
||||
apiSendCode: string;
|
||||
apiSendMsg: string;
|
||||
apiRequestId: string;
|
||||
apiSerialNo: string;
|
||||
receiveStatus?: number;
|
||||
receiveTime?: string;
|
||||
apiReceiveCode: string;
|
||||
apiReceiveMsg: string;
|
||||
createTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询短信日志列表 */
|
||||
export function getSmsLogPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemSmsLogApi.SmsLog>>(
|
||||
'/system/sms-log/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出短信日志 */
|
||||
export function exportSmsLog(params: any) {
|
||||
return requestClient.download('/system/sms-log/export-excel', { params });
|
||||
}
|
||||
77
apps/web-tdesign/src/api/system/sms/template/index.ts
Normal file
77
apps/web-tdesign/src/api/system/sms/template/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemSmsTemplateApi {
|
||||
/** 短信模板信息 */
|
||||
export interface SmsTemplate {
|
||||
id?: number;
|
||||
type?: number;
|
||||
status: number;
|
||||
code: string;
|
||||
name: string;
|
||||
content: string;
|
||||
remark: string;
|
||||
apiTemplateId: string;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
params?: string[];
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
/** 发送短信请求 */
|
||||
export interface SmsSendReqVO {
|
||||
mobile: string;
|
||||
templateCode: string;
|
||||
templateParams: Record<string, any>;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询短信模板列表 */
|
||||
export function getSmsTemplatePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemSmsTemplateApi.SmsTemplate>>(
|
||||
'/system/sms-template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询短信模板详情 */
|
||||
export function getSmsTemplate(id: number) {
|
||||
return requestClient.get<SystemSmsTemplateApi.SmsTemplate>(
|
||||
`/system/sms-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增短信模板 */
|
||||
export function createSmsTemplate(data: SystemSmsTemplateApi.SmsTemplate) {
|
||||
return requestClient.post('/system/sms-template/create', data);
|
||||
}
|
||||
|
||||
/** 修改短信模板 */
|
||||
export function updateSmsTemplate(data: SystemSmsTemplateApi.SmsTemplate) {
|
||||
return requestClient.put('/system/sms-template/update', data);
|
||||
}
|
||||
|
||||
/** 删除短信模板 */
|
||||
export function deleteSmsTemplate(id: number) {
|
||||
return requestClient.delete(`/system/sms-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除短信模板 */
|
||||
export function deleteSmsTemplateList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/sms-template/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出短信模板 */
|
||||
export function exportSmsTemplate(params: any) {
|
||||
return requestClient.download('/system/sms-template/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 发送短信 */
|
||||
export function sendSms(data: SystemSmsTemplateApi.SmsSendReqVO) {
|
||||
return requestClient.post('/system/sms-template/send-sms', data);
|
||||
}
|
||||
55
apps/web-tdesign/src/api/system/social/client/index.ts
Normal file
55
apps/web-tdesign/src/api/system/social/client/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemSocialClientApi {
|
||||
/** 社交客户端信息 */
|
||||
export interface SocialClient {
|
||||
id?: number;
|
||||
name: string;
|
||||
socialType: number;
|
||||
userType: number;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
agentId?: string;
|
||||
status: number;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询社交客户端列表 */
|
||||
export function getSocialClientPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemSocialClientApi.SocialClient>>(
|
||||
'/system/social-client/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询社交客户端详情 */
|
||||
export function getSocialClient(id: number) {
|
||||
return requestClient.get<SystemSocialClientApi.SocialClient>(
|
||||
`/system/social-client/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增社交客户端 */
|
||||
export function createSocialClient(data: SystemSocialClientApi.SocialClient) {
|
||||
return requestClient.post('/system/social-client/create', data);
|
||||
}
|
||||
|
||||
/** 修改社交客户端 */
|
||||
export function updateSocialClient(data: SystemSocialClientApi.SocialClient) {
|
||||
return requestClient.put('/system/social-client/update', data);
|
||||
}
|
||||
|
||||
/** 删除社交客户端 */
|
||||
export function deleteSocialClient(id: number) {
|
||||
return requestClient.delete(`/system/social-client/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除社交客户端 */
|
||||
export function deleteSocialClientList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/social-client/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
66
apps/web-tdesign/src/api/system/social/user/index.ts
Normal file
66
apps/web-tdesign/src/api/system/social/user/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemSocialUserApi {
|
||||
/** 社交用户信息 */
|
||||
export interface SocialUser {
|
||||
id?: number;
|
||||
type: number;
|
||||
openid: string;
|
||||
token: string;
|
||||
rawTokenInfo: string;
|
||||
nickname: string;
|
||||
avatar: string;
|
||||
rawUserInfo: string;
|
||||
code: string;
|
||||
state: string;
|
||||
createTime?: Date;
|
||||
updateTime?: Date;
|
||||
}
|
||||
|
||||
/** 社交绑定请求 */
|
||||
export interface SocialUserBindReqVO {
|
||||
type: number;
|
||||
code: string;
|
||||
state: string;
|
||||
}
|
||||
|
||||
/** 取消社交绑定请求 */
|
||||
export interface SocialUserUnbindReqVO {
|
||||
type: number;
|
||||
openid: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询社交用户列表 */
|
||||
export function getSocialUserPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemSocialUserApi.SocialUser>>(
|
||||
'/system/social-user/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询社交用户详情 */
|
||||
export function getSocialUser(id: number) {
|
||||
return requestClient.get<SystemSocialUserApi.SocialUser>(
|
||||
`/system/social-user/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 社交绑定,使用 code 授权码 */
|
||||
export function socialBind(data: SystemSocialUserApi.SocialUserBindReqVO) {
|
||||
return requestClient.post<boolean>('/system/social-user/bind', data);
|
||||
}
|
||||
|
||||
/** 取消社交绑定 */
|
||||
export function socialUnbind(data: SystemSocialUserApi.SocialUserUnbindReqVO) {
|
||||
return requestClient.delete<boolean>('/system/social-user/unbind', { data });
|
||||
}
|
||||
|
||||
/** 获得绑定社交用户列表 */
|
||||
export function getBindSocialUserList() {
|
||||
return requestClient.get<SystemSocialUserApi.SocialUser[]>(
|
||||
'/system/social-user/get-bind-list',
|
||||
);
|
||||
}
|
||||
64
apps/web-tdesign/src/api/system/tenant-package/index.ts
Normal file
64
apps/web-tdesign/src/api/system/tenant-package/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemTenantPackageApi {
|
||||
/** 租户套餐信息 */
|
||||
export interface TenantPackage {
|
||||
id: number;
|
||||
name: string;
|
||||
status: number;
|
||||
remark: string;
|
||||
creator: string;
|
||||
updater: string;
|
||||
updateTime: string;
|
||||
menuIds: number[];
|
||||
createTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 租户套餐列表 */
|
||||
export function getTenantPackagePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemTenantPackageApi.TenantPackage>>(
|
||||
'/system/tenant-package/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询租户套餐详情 */
|
||||
export function getTenantPackage(id: number) {
|
||||
return requestClient.get(`/system/tenant-package/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增租户套餐 */
|
||||
export function createTenantPackage(
|
||||
data: SystemTenantPackageApi.TenantPackage,
|
||||
) {
|
||||
return requestClient.post('/system/tenant-package/create', data);
|
||||
}
|
||||
|
||||
/** 修改租户套餐 */
|
||||
export function updateTenantPackage(
|
||||
data: SystemTenantPackageApi.TenantPackage,
|
||||
) {
|
||||
return requestClient.put('/system/tenant-package/update', data);
|
||||
}
|
||||
|
||||
/** 删除租户套餐 */
|
||||
export function deleteTenantPackage(id: number) {
|
||||
return requestClient.delete(`/system/tenant-package/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除租户套餐 */
|
||||
export function deleteTenantPackageList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/tenant-package/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取租户套餐精简信息列表 */
|
||||
export function getTenantPackageList() {
|
||||
return requestClient.get<SystemTenantPackageApi.TenantPackage[]>(
|
||||
'/system/tenant-package/get-simple-list',
|
||||
);
|
||||
}
|
||||
76
apps/web-tdesign/src/api/system/tenant/index.ts
Normal file
76
apps/web-tdesign/src/api/system/tenant/index.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemTenantApi {
|
||||
/** 租户信息 */
|
||||
export interface Tenant {
|
||||
id?: number;
|
||||
name: string;
|
||||
packageId: number;
|
||||
contactName: string;
|
||||
contactMobile: string;
|
||||
accountCount: number;
|
||||
expireTime: Date;
|
||||
websites: string[];
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 租户列表 */
|
||||
export function getTenantPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemTenantApi.Tenant>>(
|
||||
'/system/tenant/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取租户精简信息列表 */
|
||||
export function getSimpleTenantList() {
|
||||
return requestClient.get<SystemTenantApi.Tenant[]>(
|
||||
'/system/tenant/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询租户详情 */
|
||||
export function getTenant(id: number) {
|
||||
return requestClient.get<SystemTenantApi.Tenant>(
|
||||
`/system/tenant/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取租户精简信息列表 */
|
||||
export function getTenantList() {
|
||||
return requestClient.get<SystemTenantApi.Tenant[]>(
|
||||
'/system/tenant/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增租户 */
|
||||
export function createTenant(data: SystemTenantApi.Tenant) {
|
||||
return requestClient.post('/system/tenant/create', data);
|
||||
}
|
||||
|
||||
/** 修改租户 */
|
||||
export function updateTenant(data: SystemTenantApi.Tenant) {
|
||||
return requestClient.put('/system/tenant/update', data);
|
||||
}
|
||||
|
||||
/** 删除租户 */
|
||||
export function deleteTenant(id: number) {
|
||||
return requestClient.delete(`/system/tenant/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除租户 */
|
||||
export function deleteTenantList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/tenant/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出租户 */
|
||||
export function exportTenant(params: any) {
|
||||
return requestClient.download('/system/tenant/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
88
apps/web-tdesign/src/api/system/user/index.ts
Normal file
88
apps/web-tdesign/src/api/system/user/index.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemUserApi {
|
||||
/** 用户信息 */
|
||||
export interface User {
|
||||
id?: number;
|
||||
username: string;
|
||||
nickname: string;
|
||||
deptId: number;
|
||||
postIds: string[];
|
||||
email: string;
|
||||
mobile: string;
|
||||
sex: number;
|
||||
avatar: string;
|
||||
loginIp: string;
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询用户管理列表 */
|
||||
export function getUserPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<SystemUserApi.User>>(
|
||||
'/system/user/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询用户详情 */
|
||||
export function getUser(id: number) {
|
||||
return requestClient.get<SystemUserApi.User>(`/system/user/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 新增用户 */
|
||||
export function createUser(data: SystemUserApi.User) {
|
||||
return requestClient.post('/system/user/create', data);
|
||||
}
|
||||
|
||||
/** 修改用户 */
|
||||
export function updateUser(data: SystemUserApi.User) {
|
||||
return requestClient.put('/system/user/update', data);
|
||||
}
|
||||
|
||||
/** 删除用户 */
|
||||
export function deleteUser(id: number) {
|
||||
return requestClient.delete(`/system/user/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除用户 */
|
||||
export function deleteUserList(ids: number[]) {
|
||||
return requestClient.delete(`/system/user/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出用户 */
|
||||
export function exportUser(params: any) {
|
||||
return requestClient.download('/system/user/export-excel', { params });
|
||||
}
|
||||
|
||||
/** 下载用户导入模板 */
|
||||
export function importUserTemplate() {
|
||||
return requestClient.download('/system/user/get-import-template');
|
||||
}
|
||||
|
||||
/** 导入用户 */
|
||||
export function importUser(file: File, updateSupport: boolean) {
|
||||
return requestClient.upload('/system/user/import', {
|
||||
file,
|
||||
updateSupport,
|
||||
});
|
||||
}
|
||||
|
||||
/** 用户密码重置 */
|
||||
export function resetUserPassword(id: number, password: string) {
|
||||
return requestClient.put('/system/user/update-password', { id, password });
|
||||
}
|
||||
|
||||
/** 用户状态修改 */
|
||||
export function updateUserStatus(id: number, status: number) {
|
||||
return requestClient.put('/system/user/update-status', { id, status });
|
||||
}
|
||||
|
||||
/** 获取用户精简信息列表 */
|
||||
export function getSimpleUserList() {
|
||||
return requestClient.get<SystemUserApi.User[]>('/system/user/simple-list');
|
||||
}
|
||||
56
apps/web-tdesign/src/api/system/user/profile/index.ts
Normal file
56
apps/web-tdesign/src/api/system/user/profile/index.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemUserProfileApi {
|
||||
/** 用户个人中心信息 */
|
||||
export interface UserProfileRespVO {
|
||||
id: number;
|
||||
username: string;
|
||||
nickname: string;
|
||||
email?: string;
|
||||
mobile?: string;
|
||||
sex?: number;
|
||||
avatar?: string;
|
||||
loginIp: string;
|
||||
loginDate: string;
|
||||
createTime: string;
|
||||
roles: any[];
|
||||
dept: any;
|
||||
posts: any[];
|
||||
}
|
||||
|
||||
/** 更新密码请求 */
|
||||
export interface UpdatePasswordReqVO {
|
||||
oldPassword: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
/** 更新个人信息请求 */
|
||||
export interface UpdateProfileReqVO {
|
||||
nickname?: string;
|
||||
email?: string;
|
||||
mobile?: string;
|
||||
sex?: number;
|
||||
avatar?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取登录用户信息 */
|
||||
export function getUserProfile() {
|
||||
return requestClient.get<SystemUserProfileApi.UserProfileRespVO>(
|
||||
'/system/user/profile/get',
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改用户个人信息 */
|
||||
export function updateUserProfile(
|
||||
data: SystemUserProfileApi.UpdateProfileReqVO,
|
||||
) {
|
||||
return requestClient.put('/system/user/profile/update', data);
|
||||
}
|
||||
|
||||
/** 修改用户个人密码 */
|
||||
export function updateUserPassword(
|
||||
data: SystemUserProfileApi.UpdatePasswordReqVO,
|
||||
) {
|
||||
return requestClient.put('/system/user/profile/update-password', data);
|
||||
}
|
||||
Reference in New Issue
Block a user