Initial commit
This commit is contained in:
59
src/api/system/access-key/index.ts
Normal file
59
src/api/system/access-key/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { AccessKey, AccessKeyParam } from './model';
|
||||
import { PageResult } from '@/api';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 查询AccessKey列表
|
||||
*/
|
||||
export async function pageAccessKey(params: AccessKeyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AccessKey>>>(
|
||||
SERVER_API_URL + '/system/access-key/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加AccessKey
|
||||
*/
|
||||
export async function addAccessKey(data: AccessKey) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/access-key',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AccessKey
|
||||
*/
|
||||
export async function updateAccessKey(data: AccessKey) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/access-key',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除AccessKey
|
||||
*/
|
||||
export async function removeAccessKey(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/access-key/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
20
src/api/system/access-key/model/index.ts
Normal file
20
src/api/system/access-key/model/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* AccessKey
|
||||
*/
|
||||
export interface AccessKey {
|
||||
id?: number;
|
||||
phone?: string;
|
||||
accessKey?: string;
|
||||
accessSecret?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
code?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* AccessKey搜索条件
|
||||
*/
|
||||
export interface AccessKeyParam {
|
||||
id?: number;
|
||||
accessKey?: string;
|
||||
}
|
||||
11
src/api/system/appstore/index.ts
Normal file
11
src/api/system/appstore/index.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// json数据
|
||||
export function appstoreType() {
|
||||
return [
|
||||
{ value: '0', label: '全部', text: '全部', comments: '' },
|
||||
{ value: '1', label: '系统管理', text: '系统管理', comments: '' },
|
||||
{ value: '2', label: '内容管理', text: '内容管理', comments: '' },
|
||||
{ value: '3', label: '第三方应用', text: '第三方应用', comments: '' },
|
||||
{ value: '4', label: '办公协同', text: '办公协同', comments: '' },
|
||||
{ value: '5', label: '商城模块', text: '商城模块', comments: '' }
|
||||
];
|
||||
}
|
||||
13
src/api/system/appstore/model/index.ts
Normal file
13
src/api/system/appstore/model/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
export interface Appstore {
|
||||
// 消息id
|
||||
id?: number;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 时间
|
||||
time?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
}
|
||||
76
src/api/system/cache/index.ts
vendored
Normal file
76
src/api/system/cache/index.ts
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Cache, CacheParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询缓存数据
|
||||
*/
|
||||
export async function listCache(params?: CacheParam) {
|
||||
const res = await request.get<ApiResult<Cache[]>>(
|
||||
SERVER_API_URL + '/system/cache',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存数据
|
||||
* @param key
|
||||
*/
|
||||
export async function getCache(key: String) {
|
||||
const res = await request.get<ApiResult<Cache>>(
|
||||
SERVER_API_URL + '/system/cache/' + key
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新缓存数据
|
||||
* @param cache
|
||||
*/
|
||||
export async function updateCache(cache: Cache) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/cache',
|
||||
cache
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除缓存数据
|
||||
* @param key
|
||||
*/
|
||||
export async function removeCache(key?: String) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/cache/' + key
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新缓存数据
|
||||
* @param cache
|
||||
*/
|
||||
export async function updateCacheTheme(cache: Cache) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/cache/theme',
|
||||
cache
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
}
|
||||
18
src/api/system/cache/model/index.ts
vendored
Normal file
18
src/api/system/cache/model/index.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 缓存管理
|
||||
*/
|
||||
export interface Cache {
|
||||
key?: string;
|
||||
content?: string;
|
||||
uploadMethod?: any;
|
||||
expireTime?: number; // 过期时间(秒)
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface CacheParam extends PageParam {
|
||||
key?: string;
|
||||
}
|
||||
157
src/api/system/chat/index.ts
Normal file
157
src/api/system/chat/index.ts
Normal file
@@ -0,0 +1,157 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ChatConversation,
|
||||
ChatConversationParam,
|
||||
ChatMessage,
|
||||
ChatMessageParam
|
||||
} from '@/api/system/chat/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询聊天列表
|
||||
*/
|
||||
export async function pageChatConversation(params: ChatConversationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ChatConversation>>>(
|
||||
SERVER_API_URL + '/system/chat-conversation/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询聊天列表
|
||||
*/
|
||||
export async function pageChatMessage(params: ChatMessageParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ChatMessage>>>(
|
||||
SERVER_API_URL + '/system/chat-message/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
/**
|
||||
* 查询日志列表
|
||||
*/
|
||||
export async function listChatConversation(params?: ChatConversationParam) {
|
||||
const res = await request.get<ApiResult<ChatConversation[]>>(
|
||||
SERVER_API_URL + '/system/chat-conversation',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加日志
|
||||
*/
|
||||
export async function addChatMessage(data: ChatMessage) {
|
||||
const res = await request.post<ApiResult<ChatConversation>>(
|
||||
SERVER_API_URL + '/system/chat-message',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加日志
|
||||
*/
|
||||
export async function addChatConversation(data: ChatConversation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-conversation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改日志
|
||||
*/
|
||||
export async function updateChatConversation(data: any) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-conversation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定日志
|
||||
*/
|
||||
export async function bindChatConversation(data: ChatConversation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-conversation/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
*/
|
||||
export async function addBatchChatConversation(data: ChatConversation[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-conversation/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除日志
|
||||
*/
|
||||
export async function removeChatConversation(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-conversation/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除日志
|
||||
*/
|
||||
export async function removeBatchChatConversation(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-conversation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
48
src/api/system/chat/model/index.ts
Normal file
48
src/api/system/chat/model/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
|
||||
export interface ChatConversation {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
friendId?: number;
|
||||
userInfo?: User;
|
||||
friendInfo?: User;
|
||||
content: string;
|
||||
messages: ChatMessage[];
|
||||
unRead: number;
|
||||
createTime?: string;
|
||||
updateTime: string | number | Date;
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
id?: number;
|
||||
formUserId?: number;
|
||||
formUserInfo?: User;
|
||||
toUserInfo?: User;
|
||||
toUserId?: number;
|
||||
type: string;
|
||||
content: string;
|
||||
status?: number;
|
||||
createTime?: number;
|
||||
updateTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface ChatConversationParam extends PageParam {
|
||||
userId?: number;
|
||||
status: number;
|
||||
onlyFake: boolean;
|
||||
keywords: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface ChatMessageParam extends PageParam {
|
||||
formUserId?: number;
|
||||
toUserId?: number;
|
||||
type?: string;
|
||||
keywords: string;
|
||||
}
|
||||
148
src/api/system/company/index.ts
Normal file
148
src/api/system/company/index.ts
Normal file
@@ -0,0 +1,148 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Company, CompanyParam } from './model';
|
||||
import { PageResult } from '@/api';
|
||||
import { MODULES_API_URL, SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询企业资料
|
||||
*/
|
||||
export async function getCompany(params?: CompanyParam) {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
SERVER_API_URL + '/system/company/profile',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业资料不限租户
|
||||
*/
|
||||
export async function getCompanyAll(companyId: number) {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
MODULES_API_URL + '/system/company/profileAll/' + companyId
|
||||
);
|
||||
if (res.data.code === 0 && res.data) {
|
||||
console.log(res.data);
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询Company列表
|
||||
*/
|
||||
export async function pageCompany(params: CompanyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Company>>>(
|
||||
MODULES_API_URL + '/system/company/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询Company列表不限租户
|
||||
*/
|
||||
export async function pageCompanyAll(params: CompanyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Company>>>(
|
||||
SERVER_API_URL + '/system/company/pageAll',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加Company
|
||||
*/
|
||||
export async function addCompany(data: Company) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/system/company',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改Company
|
||||
*/
|
||||
export async function updateCompany(data: Company) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Company
|
||||
*/
|
||||
export async function removeCompany(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/system/company/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 销毁租户
|
||||
export async function destructionTenant(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/system/company/destruction/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除Company
|
||||
*/
|
||||
export async function removeBatchCompany(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/system/company/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/system/company/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
89
src/api/system/company/model/index.ts
Normal file
89
src/api/system/company/model/index.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
*/
|
||||
export interface Company {
|
||||
companyId?: number;
|
||||
shortName?: string;
|
||||
companyName?: string;
|
||||
companyType?: number;
|
||||
companyTypeMultiple?: string;
|
||||
appType?: string;
|
||||
companyLogo?: string;
|
||||
companyCode?: string;
|
||||
domain?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
InvoiceHeader?: string;
|
||||
startTime?: string;
|
||||
expirationTime?: string;
|
||||
version?: number;
|
||||
versionName?: string;
|
||||
versionCode?: string;
|
||||
members?: number;
|
||||
storage?: string;
|
||||
storageMax?: string;
|
||||
buys?: number;
|
||||
clicks?: number;
|
||||
users?: number;
|
||||
departments?: number;
|
||||
industryParent?: string;
|
||||
industryChild?: string;
|
||||
country?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
address?: string;
|
||||
latitude?: string;
|
||||
longitude?: string;
|
||||
businessEntity?: string;
|
||||
comments?: any;
|
||||
authentication?: number;
|
||||
industryId?: number;
|
||||
industryName?: string;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
planId?: number;
|
||||
sortNumber?: number;
|
||||
authoritative?: boolean;
|
||||
tenantId?: number;
|
||||
tenantName?: string;
|
||||
tenantCode?: string;
|
||||
modules?: string;
|
||||
requestUrl?: string;
|
||||
socketUrl?: string;
|
||||
serverUrl?: string;
|
||||
modulesUrl?: string;
|
||||
avatar?: string;
|
||||
nickname?: string;
|
||||
code?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
password?: string;
|
||||
password2?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业信息搜索条件
|
||||
*/
|
||||
export interface CompanyParam extends PageParam {
|
||||
companyId?: number;
|
||||
shortName?: string;
|
||||
companyName?: string;
|
||||
domain?: string;
|
||||
recommend?: boolean;
|
||||
keywords?: any;
|
||||
authoritative?: number;
|
||||
authentication?: number;
|
||||
industryParent?: string;
|
||||
industryChild?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
version?: number;
|
||||
sceneType?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
87
src/api/system/dict-data/index.ts
Normal file
87
src/api/system/dict-data/index.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DictData, DictDataParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询字典数据
|
||||
*/
|
||||
export async function pageDictData(params: DictDataParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DictData>>>(
|
||||
SERVER_API_URL + '/system/dict-data/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典数据列表
|
||||
*/
|
||||
export async function listDictData(params: DictDataParam) {
|
||||
const res = await request.get<ApiResult<DictData[]>>(
|
||||
SERVER_API_URL + '/system/dict-data',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加字典数据
|
||||
*/
|
||||
export async function addDictData(data: DictData) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
*/
|
||||
export async function updateDictData(data: DictData) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
*/
|
||||
export async function removeDictData(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典数据
|
||||
*/
|
||||
export async function removeDictDataBatch(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
45
src/api/system/dict-data/model/index.ts
Normal file
45
src/api/system/dict-data/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
*/
|
||||
export interface DictData {
|
||||
// 字典数据id
|
||||
dictDataId?: number;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
// 字典名称
|
||||
dictName?: string;
|
||||
// 字典数据标识
|
||||
dictDataCode?: string;
|
||||
// 字典数据名称
|
||||
dictDataName?: string;
|
||||
// 字典标识
|
||||
dictCode?: string;
|
||||
// 排序号
|
||||
sortNumber?: any;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
label?: string;
|
||||
value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典数据搜索条件
|
||||
*/
|
||||
export interface DictDataParam extends PageParam {
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 字典标识
|
||||
dictCode?: string;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
label?: string;
|
||||
dictDataId?: number;
|
||||
}
|
||||
61
src/api/system/dict/index.ts
Normal file
61
src/api/system/dict/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Dict, DictParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询字典列表
|
||||
*/
|
||||
export async function listDictionaries(params?: DictParam) {
|
||||
const res = await request.get<ApiResult<Dict[]>>(
|
||||
SERVER_API_URL + '/system/dict',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加字典
|
||||
*/
|
||||
export async function addDict(data: Dict) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典
|
||||
*/
|
||||
export async function updateDict(data: Dict) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典
|
||||
*/
|
||||
export async function removeDict(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/system/dict/model/index.ts
Normal file
29
src/api/system/dict/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 字典
|
||||
*/
|
||||
export interface Dict {
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
// 字典标识
|
||||
dictCode?: string;
|
||||
// 字典名称
|
||||
dictName?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
type?: number;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典搜索条件
|
||||
*/
|
||||
export interface DictParam {
|
||||
dictCode?: string;
|
||||
dictName?: string;
|
||||
type?: number;
|
||||
tenantId?: number;
|
||||
}
|
||||
87
src/api/system/dictionary-data/index.ts
Normal file
87
src/api/system/dictionary-data/index.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DictionaryData, DictionaryDataParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询字典数据
|
||||
*/
|
||||
export async function pageDictionaryData(params: DictionaryDataParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DictionaryData>>>(
|
||||
SERVER_API_URL + '/system/dict-data/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典数据列表
|
||||
*/
|
||||
export async function listDictionaryData(params: DictionaryDataParam) {
|
||||
const res = await request.get<ApiResult<DictionaryData[]>>(
|
||||
SERVER_API_URL + '/system/dict-data',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加字典数据
|
||||
*/
|
||||
export async function addDictionaryData(data: DictionaryData) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
*/
|
||||
export async function updateDictionaryData(data: DictionaryData) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
*/
|
||||
export async function removeDictionaryData(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典数据
|
||||
*/
|
||||
export async function removeDictionaryDataBatch(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dict-data/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
src/api/system/dictionary-data/model/index.ts
Normal file
33
src/api/system/dictionary-data/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
*/
|
||||
export interface DictionaryData {
|
||||
// 字典数据id
|
||||
dictDataId?: number;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
// 字典数据标识
|
||||
dictDataCode?: string;
|
||||
// 字典数据名称
|
||||
dictDataName?: string;
|
||||
// 排序号
|
||||
sortNumber?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典数据搜索条件
|
||||
*/
|
||||
export interface DictionaryDataParam extends PageParam {
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 字典标识
|
||||
dictCode?: string;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
}
|
||||
61
src/api/system/dictionary/index.ts
Normal file
61
src/api/system/dictionary/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Dictionary, DictionaryParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询字典列表
|
||||
*/
|
||||
export async function listDictionaries(params?: DictionaryParam) {
|
||||
const res = await request.get<ApiResult<Dictionary[]>>(
|
||||
SERVER_API_URL + '/system/dictionary',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加字典
|
||||
*/
|
||||
export async function addDictionary(data: Dictionary) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dictionary',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典
|
||||
*/
|
||||
export async function updateDictionary(data: Dictionary) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dictionary',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典
|
||||
*/
|
||||
export async function removeDictionary(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/dictionary/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/system/dictionary/model/index.ts
Normal file
29
src/api/system/dictionary/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 字典
|
||||
*/
|
||||
export interface Dictionary {
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
// 字典标识
|
||||
dictCode?: string;
|
||||
// 字典名称
|
||||
dictName?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
type?: number;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典搜索条件
|
||||
*/
|
||||
export interface DictionaryParam {
|
||||
dictCode?: string;
|
||||
dictName?: string;
|
||||
type?: number;
|
||||
tenantId?: number;
|
||||
}
|
||||
125
src/api/system/environment/index.ts
Normal file
125
src/api/system/environment/index.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Environment, EnvironmentParam } from './model/index';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pageEnvironment(params?: EnvironmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Environment>>>(
|
||||
SERVER_API_URL + '/system/environment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listEnvironment(params?: EnvironmentParam) {
|
||||
const res = await request.get<ApiResult<Environment[]>>(
|
||||
SERVER_API_URL + '/system/environment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用
|
||||
*/
|
||||
export async function getEnvironment(id: number) {
|
||||
const res = await request.get<ApiResult<Environment>>(
|
||||
SERVER_API_URL + '/system/environment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updateEnvironment(data: Environment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/environment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 排行榜
|
||||
export async function ranking(params?: EnvironmentParam) {
|
||||
const res = await request.get<ApiResult<Environment[]>>(
|
||||
SERVER_API_URL + '/system/environment/ranking',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/environment/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 搜索历史
|
||||
export async function searchHistory(params?: String) {
|
||||
const res = await request.get<ApiResult<String[]>>(
|
||||
SERVER_API_URL + '/system/environment/search-history',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 制作插件
|
||||
*/
|
||||
export async function createEnvironment(data: Environment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/environment/environment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
src/api/system/environment/model/index.ts
Normal file
25
src/api/system/environment/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
export interface Environment {
|
||||
id?: number;
|
||||
environmentName?: string;
|
||||
environmentCode?: string;
|
||||
brand?: string;
|
||||
serverIp?: string;
|
||||
modulesUrl?: string;
|
||||
modulesApi?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件搜索条件
|
||||
*/
|
||||
export interface EnvironmentParam extends PageParam {
|
||||
id: number;
|
||||
environmentName: string;
|
||||
}
|
||||
215
src/api/system/file/index.ts
Normal file
215
src/api/system/file/index.ts
Normal file
@@ -0,0 +1,215 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { FileRecord, FileRecordParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
import { FILE_SERVER } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
export async function uploadFileLocal(file: File, AppId: number) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
FILE_SERVER + '/api/file/upload',
|
||||
formData,
|
||||
{
|
||||
headers: { AppId }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
export async function uploadFileLocalByCompany(file: File, CompanyId: number) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
FILE_SERVER + '/api/file/upload',
|
||||
formData,
|
||||
{
|
||||
headers: { CompanyId }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
export async function uploadFile(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
SERVER_API_URL + '/oss/upload',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传 base64 文件
|
||||
* @param base64 文件数据
|
||||
* @param fileName 文件名称
|
||||
*/
|
||||
export async function uploadBase64File(base64: string, fileName?: string) {
|
||||
const formData = new FormData();
|
||||
formData.append('base64', base64);
|
||||
if (fileName) {
|
||||
formData.append('fileName', fileName);
|
||||
}
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
SERVER_API_URL + '/file/upload/base64',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传证书
|
||||
*/
|
||||
export async function uploadCert(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
SERVER_API_URL + '/file/upload',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询文件上传记录
|
||||
*/
|
||||
export async function pageFiles(params: FileRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<FileRecord>>>(
|
||||
SERVER_API_URL + '/file/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询文件
|
||||
*/
|
||||
export async function getFile(id: number) {
|
||||
const res = await request.get<ApiResult<FileRecord>>(
|
||||
SERVER_API_URL + '/file/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
export async function removeFile(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/file/remove/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除文件
|
||||
*/
|
||||
export async function removeFiles(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/file/remove/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文件
|
||||
*/
|
||||
export async function addFiles(data: FileRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/file',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件
|
||||
*/
|
||||
export async function updateFiles(data: FileRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/file',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传阿里云OSS
|
||||
*/
|
||||
export async function uploadOss(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
SERVER_API_URL + '/oss/upload',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传阿里云OSS
|
||||
*/
|
||||
export async function uploadOssByGroupId(file: File, GroupId: string) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
SERVER_API_URL + '/oss/upload',
|
||||
formData,
|
||||
{
|
||||
headers: { GroupId }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
52
src/api/system/file/model/index.ts
Normal file
52
src/api/system/file/model/index.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文件上传记录
|
||||
*/
|
||||
export interface FileRecord {
|
||||
// id
|
||||
id: number;
|
||||
// 文件名称
|
||||
name?: string;
|
||||
// 文件存储路径
|
||||
path?: string;
|
||||
// 文件大小
|
||||
length?: number;
|
||||
// 文件类型
|
||||
contentType?: string;
|
||||
// 上传人id
|
||||
createUserId?: number;
|
||||
// 分组ID
|
||||
groupId?: number;
|
||||
groupName?: string;
|
||||
// 上传时间
|
||||
createTime?: string;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 文件访问地址
|
||||
url?: string;
|
||||
// 文件缩略图访问地址
|
||||
thumbnail?: string;
|
||||
// 文件下载地址
|
||||
downloadUrl?: string;
|
||||
// 上传人账号
|
||||
createUsername?: string;
|
||||
// 上传人名称
|
||||
createNickname?: string;
|
||||
// 是否编辑状态
|
||||
isUpdate?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传记录查询参数
|
||||
*/
|
||||
export interface FileRecordParam extends PageParam {
|
||||
name?: string;
|
||||
path?: string;
|
||||
contentType?: string;
|
||||
createNickname?: string;
|
||||
groupId?: number;
|
||||
groupName?: string;
|
||||
count?: number;
|
||||
page?: number;
|
||||
}
|
||||
32
src/api/system/login-record/index.ts
Normal file
32
src/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
src/api/system/login-record/model/index.ts
Normal file
38
src/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;
|
||||
}
|
||||
127
src/api/system/menu/index.ts
Normal file
127
src/api/system/menu/index.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Menu, MenuParam } from './model';
|
||||
import { App } from '@/api/dashboard/appstore/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询菜单列表
|
||||
*/
|
||||
export async function listMenus(params: MenuParam) {
|
||||
const res = await request.get<ApiResult<Menu[]>>(
|
||||
SERVER_API_URL + '/system/menu',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加菜单
|
||||
*/
|
||||
export async function addMenu(data: Menu) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜单
|
||||
*/
|
||||
export async function updateMenu(data: Menu) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
*/
|
||||
export async function removeMenu(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 安装应用
|
||||
*/
|
||||
export async function installApp(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/install',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 卸载应用
|
||||
*/
|
||||
export async function uninstallApp(data: App) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/uninstall',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 菜单克隆
|
||||
export async function clone(data: Menu) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/clone',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 制作插件
|
||||
*/
|
||||
export async function createPlug(data: Menu) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/plug',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 安装插件
|
||||
export async function installPlug(id?: number) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/install/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
67
src/api/system/menu/model/index.ts
Normal file
67
src/api/system/menu/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
export interface Menu {
|
||||
// 菜单id
|
||||
menuId?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 菜单名称
|
||||
title: string;
|
||||
// 菜单路由地址
|
||||
path: string;
|
||||
// 菜单组件地址
|
||||
component: string;
|
||||
// 模块API
|
||||
modulesUrl?: string;
|
||||
// 模块ID
|
||||
modules?: string;
|
||||
// 菜单类型, 0菜单, 1按钮
|
||||
menuType?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 菜单图标
|
||||
icon?: string;
|
||||
// 是否隐藏, 0否,1是(仅注册路由不显示左侧菜单)
|
||||
hide?: number;
|
||||
// 路由元信息
|
||||
meta?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 子菜单
|
||||
children?: Menu[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
disabled?: boolean;
|
||||
//
|
||||
appId?: number;
|
||||
//
|
||||
tenantId?: number;
|
||||
tenantName?: string;
|
||||
companyId?: number;
|
||||
// 插件Api
|
||||
plugUrl?: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单搜索参数
|
||||
*/
|
||||
export interface MenuParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
menuType?: number;
|
||||
hide?: number;
|
||||
}
|
||||
118
src/api/system/modules/index.ts
Normal file
118
src/api/system/modules/index.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Modules, ModulesParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询角色module
|
||||
*/
|
||||
export async function pageModules(params) {
|
||||
const res = await request.get<ApiResult<PageResult<Modules>>>(
|
||||
SERVER_API_URL + '/system/modules/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*/
|
||||
export async function listModules(params?: ModulesParam) {
|
||||
const res = await request.get<ApiResult<Modules[]>>(
|
||||
SERVER_API_URL + '/system/modules',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
*/
|
||||
export async function addModules(data: Modules) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/modules',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
export async function updateModules(data: Modules) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/modules',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
export async function removeModules(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/modules/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*/
|
||||
export async function removeModulesBath(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/modules/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色分配的菜单
|
||||
*/
|
||||
export async function listModulesMenus(modulesId?: number) {
|
||||
const res = await request.get<ApiResult<Modules[]>>(
|
||||
SERVER_API_URL + '/system/modules-menu/' + modulesId
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色菜单
|
||||
*/
|
||||
export async function updateModulesMenus(modulesId?: number, data?: number[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/modules-menu/' + modulesId,
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
22
src/api/system/modules/model/index.ts
Normal file
22
src/api/system/modules/model/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
export interface Modules {
|
||||
id?: number;
|
||||
modules?: string;
|
||||
modulesUrl?: string;
|
||||
sortNumber?: number;
|
||||
comments?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件搜索条件
|
||||
*/
|
||||
export interface ModulesParam extends PageParam {
|
||||
id: number;
|
||||
modules: string;
|
||||
modulesUrl?: string;
|
||||
}
|
||||
32
src/api/system/operation-record/index.ts
Normal file
32
src/api/system/operation-record/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OperationRecord, OperationRecordParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询操作日志
|
||||
*/
|
||||
export async function pageOperationRecords(params: OperationRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OperationRecord>>>(
|
||||
SERVER_API_URL + '/system/operation-record/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询操作日志列表
|
||||
*/
|
||||
export async function listOperationRecords(params?: OperationRecordParam) {
|
||||
const res = await request.get<ApiResult<OperationRecord[]>>(
|
||||
SERVER_API_URL + '/system/operation-record',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
56
src/api/system/operation-record/model/index.ts
Normal file
56
src/api/system/operation-record/model/index.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 操作日志
|
||||
*/
|
||||
export interface OperationRecord {
|
||||
// 操作日志id
|
||||
id?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 操作模块
|
||||
module: string;
|
||||
// 操作功能
|
||||
description: string;
|
||||
// 请求地址
|
||||
url: string;
|
||||
// 请求方式
|
||||
requestMethod: string;
|
||||
// 调用方法
|
||||
method: string;
|
||||
// 请求参数
|
||||
params: string;
|
||||
// 返回结果
|
||||
result: string;
|
||||
// 异常信息
|
||||
error: string;
|
||||
// 消耗时间, 单位毫秒
|
||||
spendTime: number;
|
||||
// 操作系统
|
||||
os: string;
|
||||
// 设备名称
|
||||
device: string;
|
||||
// 浏览器类型
|
||||
browser: string;
|
||||
// ip地址
|
||||
ip: string;
|
||||
// 状态, 0成功, 1异常
|
||||
status: number;
|
||||
// 操作时间
|
||||
createTime: string;
|
||||
// 用户昵称
|
||||
nickname: string;
|
||||
// 用户账号
|
||||
username: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作日志搜索条件
|
||||
*/
|
||||
export interface OperationRecordParam extends PageParam {
|
||||
username?: string;
|
||||
module?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
status?: number;
|
||||
}
|
||||
73
src/api/system/organization/index.ts
Normal file
73
src/api/system/organization/index.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Organization, OrganizationParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询机构
|
||||
*/
|
||||
export async function pageOrganizations(params: OrganizationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Organization>>>(
|
||||
SERVER_API_URL + '/system/organization/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询机构列表
|
||||
*/
|
||||
export async function listOrganizations(params?: OrganizationParam) {
|
||||
const res = await request.get<ApiResult<Organization[]>>(
|
||||
SERVER_API_URL + '/system/organization',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加机构
|
||||
*/
|
||||
export async function addOrganization(data: Organization) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/organization',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改机构
|
||||
*/
|
||||
export async function updateOrganization(data: Organization) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/organization',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除机构
|
||||
*/
|
||||
export async function removeOrganization(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/organization/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
42
src/api/system/organization/model/index.ts
Normal file
42
src/api/system/organization/model/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 机构
|
||||
*/
|
||||
export interface Organization {
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 机构名称
|
||||
organizationName?: string;
|
||||
// 机构全称
|
||||
organizationFullName?: string;
|
||||
// 机构代码
|
||||
organizationCode?: string;
|
||||
// 机构类型(字典)
|
||||
organizationType?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 机构类型名称
|
||||
organizationTypeName?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
title?: string;
|
||||
children?: Organization[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构搜索条件
|
||||
*/
|
||||
export interface OrganizationParam extends PageParam {
|
||||
organizationName?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
125
src/api/system/plug/index.ts
Normal file
125
src/api/system/plug/index.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Plug, PlugParam } from './model/index';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pagePlug(params: PlugParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Plug>>>(
|
||||
SERVER_API_URL + '/system/plug/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用列表
|
||||
*/
|
||||
export async function listPlug(params?: PlugParam) {
|
||||
const res = await request.get<ApiResult<Plug[]>>(
|
||||
SERVER_API_URL + '/system/plug',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用
|
||||
*/
|
||||
export async function getPlug(id: number) {
|
||||
const res = await request.get<ApiResult<Plug>>(
|
||||
SERVER_API_URL + '/system/plug/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用
|
||||
*/
|
||||
export async function updatePlug(data: Plug) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/plug',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 排行榜
|
||||
export async function ranking(params?: PlugParam) {
|
||||
const res = await request.get<ApiResult<Plug[]>>(
|
||||
SERVER_API_URL + '/system/plug/ranking',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/plug/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 搜索历史
|
||||
export async function searchHistory(params?: String) {
|
||||
const res = await request.get<ApiResult<String[]>>(
|
||||
SERVER_API_URL + '/system/plug/search-history',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 制作插件
|
||||
*/
|
||||
export async function createPlug(data: Plug) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/plug/plug',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
67
src/api/system/plug/model/index.ts
Normal file
67
src/api/system/plug/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
export interface Plug {
|
||||
plugId?: number;
|
||||
plugName?: string;
|
||||
plugCode?: string;
|
||||
// 菜单id
|
||||
menuId?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 菜单名称
|
||||
title?: string;
|
||||
// 菜单路由地址
|
||||
path?: string;
|
||||
// 菜单组件地址
|
||||
component?: string;
|
||||
// 菜单类型, 0菜单, 1按钮
|
||||
menuType?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 权限标识
|
||||
authority?: string;
|
||||
// 菜单图标
|
||||
icon?: string;
|
||||
// 是否隐藏, 0否,1是(仅注册路由不显示左侧菜单)
|
||||
hide?: number;
|
||||
// 路由元信息
|
||||
meta?: string;
|
||||
score?: number;
|
||||
price?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 子菜单
|
||||
children?: Plug[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
shortName?: string;
|
||||
comments?: string;
|
||||
content?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
//
|
||||
userId?: number;
|
||||
//
|
||||
appId?: number;
|
||||
status?: number;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件搜索条件
|
||||
*/
|
||||
export interface PlugParam extends PageParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
119
src/api/system/role/index.ts
Normal file
119
src/api/system/role/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Role, RoleParam } from './model';
|
||||
import type { Menu } from '../menu/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询角色
|
||||
*/
|
||||
export async function pageRoles(params: RoleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Role>>>(
|
||||
SERVER_API_URL + '/system/role/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*/
|
||||
export async function listRoles(params?: RoleParam) {
|
||||
const res = await request.get<ApiResult<Role[]>>(
|
||||
SERVER_API_URL + '/system/role',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
*/
|
||||
export async function addRole(data: Role) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/role',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
export async function updateRole(data: Role) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/role',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
export async function removeRole(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/role/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*/
|
||||
export async function removeRoles(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/role/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色分配的菜单
|
||||
*/
|
||||
export async function listRoleMenus(roleId?: number) {
|
||||
const res = await request.get<ApiResult<Menu[]>>(
|
||||
SERVER_API_URL + '/system/role-menu/' + roleId
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色菜单
|
||||
*/
|
||||
export async function updateRoleMenus(roleId?: number, data?: number[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/role-menu/' + roleId,
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
27
src/api/system/role/model/index.ts
Normal file
27
src/api/system/role/model/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
export interface Role {
|
||||
// 角色id
|
||||
roleId?: number;
|
||||
// 角色标识
|
||||
roleCode?: string;
|
||||
// 角色名称
|
||||
roleName?: string;
|
||||
sortNumber?: any;
|
||||
// 备注
|
||||
comments?: any;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色搜索条件
|
||||
*/
|
||||
export interface RoleParam extends PageParam {
|
||||
roleName?: string;
|
||||
roleCode?: string;
|
||||
comments?: string;
|
||||
}
|
||||
126
src/api/system/setting/index.ts
Normal file
126
src/api/system/setting/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Setting, SettingParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询设置
|
||||
*/
|
||||
export async function pageSetting(params: SettingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Setting>>>(
|
||||
SERVER_API_URL + '/system/setting/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设置列表
|
||||
*/
|
||||
export async function listSetting(params?: SettingParam) {
|
||||
const res = await request.get<ApiResult<Setting[]>>(
|
||||
SERVER_API_URL + '/system/setting',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getSetting(id: number) {
|
||||
const res = await request.get<ApiResult<Setting>>(
|
||||
SERVER_API_URL + '/system/setting/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设置
|
||||
*/
|
||||
export async function addSetting(data: Setting) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/setting',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设置
|
||||
*/
|
||||
export async function updateSetting(data: Setting) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/setting',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设置
|
||||
*/
|
||||
export async function removeSetting(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/setting/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设置
|
||||
*/
|
||||
export async function removeBatchSetting(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/setting/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/setting/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
127
src/api/system/setting/model/index.ts
Normal file
127
src/api/system/setting/model/index.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 系统设置
|
||||
*/
|
||||
export interface Setting {
|
||||
// 公共字段
|
||||
settingId?: number;
|
||||
settingKey?: string;
|
||||
content?: string;
|
||||
comments?: string;
|
||||
tenantName?: string;
|
||||
tenantId?: string | null;
|
||||
|
||||
// 设置信息
|
||||
siteName?: string;
|
||||
fullName?: string;
|
||||
tenantCode?: string;
|
||||
domain?: string;
|
||||
remarks?: string;
|
||||
icp?: string;
|
||||
copyright?: string;
|
||||
keyword?: string;
|
||||
phone?: string;
|
||||
company?: string;
|
||||
address?: string;
|
||||
email?: string;
|
||||
support?: string;
|
||||
logo?: string;
|
||||
|
||||
// 注册设置
|
||||
roleId?: number;
|
||||
openWxAuth?: number;
|
||||
openWxBindPhone?: number;
|
||||
openWxofficialAuth?: number;
|
||||
openWxofficialBindPhone?: number;
|
||||
tokenExpireTime?: number;
|
||||
|
||||
// 短信设置
|
||||
type?: number;
|
||||
accessKeyId?: string;
|
||||
accessKeySecret?: string;
|
||||
sign?: string;
|
||||
isNoticeUser?: string;
|
||||
userTemplateId?: string;
|
||||
merchantTemplateId?: string;
|
||||
isNoticeMerchant?: string;
|
||||
merchantMobiles?: string;
|
||||
|
||||
// 支付设置
|
||||
payMethod?: string;
|
||||
signMode?: string;
|
||||
alipayAppId?: string;
|
||||
signType?: string;
|
||||
appCertPublicKey?: string;
|
||||
alipayCertPublicKey?: string;
|
||||
alipayRootCert?: string;
|
||||
alipayPublicKey?: string;
|
||||
privateKey?: string;
|
||||
decryptKey?: string;
|
||||
balanceIsEnable?: boolean;
|
||||
wechatIsEnable?: boolean;
|
||||
alipayIsEnable?: boolean;
|
||||
wechatType?: string;
|
||||
mchId?: number;
|
||||
wechatAppId?: string;
|
||||
wechatApiKey?: string;
|
||||
apiclientCert?: string;
|
||||
apiclientKey?: string;
|
||||
spAppId?: string;
|
||||
spMchId?: string;
|
||||
spApiKey?: string;
|
||||
spSubAppId?: string;
|
||||
spSubMchId?: string;
|
||||
spApiclientCert?: string;
|
||||
spApiclientKey?: string;
|
||||
merchantSerialNumber?: string;
|
||||
|
||||
// 微信公众号/小程序设置
|
||||
appId?: string;
|
||||
appSecret?: string;
|
||||
wxOfficialAccount?: string;
|
||||
originalId?: string;
|
||||
|
||||
// 企业微信参数
|
||||
suiteId?: string;
|
||||
secret?: string;
|
||||
corpId?: string;
|
||||
token?: string;
|
||||
encodingAESKey?: string;
|
||||
|
||||
// 打印设置
|
||||
isOpenPrinter?: string;
|
||||
printerType?: string;
|
||||
printerStatus?: string;
|
||||
printerUser?: string;
|
||||
printerUserKey?: string;
|
||||
printerCode?: string;
|
||||
printerKey?: string;
|
||||
printerTimes?: string;
|
||||
|
||||
// chatGPT
|
||||
chatKey?: string;
|
||||
|
||||
// 清除缓存
|
||||
clearCache?: string;
|
||||
|
||||
// 主题
|
||||
theme?: string;
|
||||
|
||||
// 云存储
|
||||
uploadMethod?: any;
|
||||
fileUrl?: string;
|
||||
bucketName?: string;
|
||||
bucketEndpoint?: string;
|
||||
bucketDomain?: string;
|
||||
// accessKeyId?: string; 引用上面的
|
||||
// accessKeySecret?: string; 引用上面的
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统设置搜索条件
|
||||
*/
|
||||
export interface SettingParam extends PageParam {
|
||||
settingId?: number;
|
||||
settingKey?: string;
|
||||
}
|
||||
178
src/api/system/tennat/index.ts
Normal file
178
src/api/system/tennat/index.ts
Normal file
@@ -0,0 +1,178 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Tenant, TenantParam } from './model';
|
||||
import { Menu } from '@/api/system/menu/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询租户
|
||||
*/
|
||||
export async function pageTenant(params: TenantParam) {
|
||||
// 租户列表查询需要传一个key
|
||||
// params.tenantCode = 'ZAcxbdmDQFwUKC3e';
|
||||
const res = await request.get<ApiResult<PageResult<Tenant>>>(
|
||||
SERVER_API_URL + '/system/tenant/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户资料
|
||||
*/
|
||||
export async function profile(params?: TenantParam) {
|
||||
const res = await request.get<ApiResult<Tenant>>(
|
||||
SERVER_API_URL + '/system/tenant/profile',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询租户列表
|
||||
*/
|
||||
export async function listTenant(params?: TenantParam) {
|
||||
const res = await request.get<ApiResult<Tenant[]>>(
|
||||
SERVER_API_URL + '/system/tenant',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getTenant(id: number) {
|
||||
const res = await request.get<ApiResult<Tenant>>(
|
||||
SERVER_API_URL + '/system/tenant/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加租户
|
||||
*/
|
||||
export async function addTenant(data: Tenant) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户
|
||||
*/
|
||||
export async function updateTenant(data: Tenant) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户
|
||||
*/
|
||||
export async function removeTenant(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除租户
|
||||
*/
|
||||
export async function removeBatchTenant(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*/
|
||||
export async function updateTenantPassword(
|
||||
tenantId?: number,
|
||||
password = 'gxwebsoft.com'
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant/password',
|
||||
{
|
||||
tenantId,
|
||||
password
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户初始化
|
||||
*/
|
||||
export async function initialization(roleId?: number) {
|
||||
const res = await request.get<ApiResult<Menu[]>>(
|
||||
SERVER_API_URL + '/system/tenant/role-menu/' + roleId
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/system/tennat/model/index.ts
Normal file
43
src/api/system/tennat/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { Company } from '@/api/system/company/model';
|
||||
|
||||
/**
|
||||
* 租户
|
||||
*/
|
||||
export interface Tenant {
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 租户名称
|
||||
tenantName?: string;
|
||||
// 应用ID
|
||||
appId?: string;
|
||||
// 应用秘钥
|
||||
appSecret?: string;
|
||||
// logo
|
||||
logo?: string;
|
||||
// 企业名称
|
||||
companyName?: string;
|
||||
// 关联客户ID
|
||||
companyId?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
//
|
||||
password?: string;
|
||||
// 企业信息
|
||||
company?: Company | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 租户搜索条件
|
||||
*/
|
||||
export interface TenantParam extends PageParam {
|
||||
tenantName?: string;
|
||||
appId?: string;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
tenantCode?: string;
|
||||
}
|
||||
89
src/api/system/user-file/index.ts
Normal file
89
src/api/system/user-file/index.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserFile, UserFileParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询用户文件
|
||||
*/
|
||||
export async function pageUserFiles(params: UserFileParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserFile>>>(
|
||||
SERVER_API_URL + '/system/user-file/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户文件列表
|
||||
*/
|
||||
export async function listUserFiles(params: UserFileParam) {
|
||||
const res = await request.get<ApiResult<UserFile[]>>(
|
||||
SERVER_API_URL + '/system/user-file',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户文件
|
||||
*/
|
||||
export async function addUserFile(data: UserFile) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-file',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户文件
|
||||
*/
|
||||
export async function updateUserFile(data: UserFile) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-file',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户文件
|
||||
*/
|
||||
export async function removeUserFile(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-file/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户文件
|
||||
*/
|
||||
export async function removeUserFiles(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-file/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/system/user-file/model/index.ts
Normal file
39
src/api/system/user-file/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户文件
|
||||
*/
|
||||
export interface UserFile {
|
||||
// id
|
||||
id?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 文件名称
|
||||
name?: string;
|
||||
// 是否是文件夹, 0否, 1是
|
||||
isDirectory?: number;
|
||||
// 上级id
|
||||
parentId?: number;
|
||||
// 文件存储路径
|
||||
path?: string;
|
||||
// 文件大小
|
||||
length?: number;
|
||||
// 文件类型
|
||||
contentType?: string;
|
||||
// 上传时间
|
||||
createTime?: string;
|
||||
// 文件访问地址
|
||||
url?: string;
|
||||
// 文件缩略图访问地址
|
||||
thumbnail?: string;
|
||||
// 文件下载地址
|
||||
downloadUrl?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户文件查询参数
|
||||
*/
|
||||
export interface UserFileParam extends PageParam {
|
||||
name?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
120
src/api/system/user-group/index.ts
Normal file
120
src/api/system/user-group/index.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Group, GroupParam } from '@/api/system/user-group/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageGroup(params: GroupParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Group>>>(
|
||||
SERVER_API_URL + '/system/user-group/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listGroup(params?: GroupParam) {
|
||||
const res = await request.get<ApiResult<Group[]>>(
|
||||
SERVER_API_URL + '/system/user-group',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addGroup(data: Group) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-group',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateGroup(data: Group) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-group',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindGroup(data: Group) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-group/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchGroup(data: Group[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-group/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeGroup(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-group/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchGroup(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-group/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
23
src/api/system/user-group/model/index.ts
Normal file
23
src/api/system/user-group/model/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Group {
|
||||
groupId?: number;
|
||||
name?: string;
|
||||
status?: number;
|
||||
comments?: any;
|
||||
sortNumber?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface GroupParam extends PageParam {
|
||||
groupId?: number;
|
||||
name?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
236
src/api/system/user/index.ts
Normal file
236
src/api/system/user/index.ts
Normal file
@@ -0,0 +1,236 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { User, UserParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询用户
|
||||
*/
|
||||
export async function pageUsers(params: UserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<User>>>(
|
||||
SERVER_API_URL + '/system/user/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
export async function listUsers(params?: UserParam) {
|
||||
const res = await request.get<ApiResult<User[]>>(
|
||||
SERVER_API_URL + '/system/user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
export async function getStaffs(params?: UserParam) {
|
||||
const res = await request.get<ApiResult<User[]>>(
|
||||
SERVER_API_URL + '/system/user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
export async function getCompanyList(params?: UserParam) {
|
||||
const res = await request.get<ApiResult<User[]>>(
|
||||
SERVER_API_URL + '/system/user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户
|
||||
*/
|
||||
export async function getUser(id: number) {
|
||||
const res = await request.get<ApiResult<User>>(
|
||||
SERVER_API_URL + '/system/user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户
|
||||
*/
|
||||
export async function addUser(data: User) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
export async function updateUser(data: User) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
*/
|
||||
export async function removeUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户
|
||||
*/
|
||||
export async function removeUsers(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateUserStatus(userId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/status',
|
||||
{
|
||||
userId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改推荐状态
|
||||
*/
|
||||
export async function updateUserRecommend(form) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/recommend',
|
||||
form
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*/
|
||||
export async function updateUserPassword(userId?: number, password = '123456') {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/password',
|
||||
{
|
||||
userId,
|
||||
password
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户
|
||||
*/
|
||||
export async function importUsers(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/import',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计用户余额
|
||||
*/
|
||||
export async function countUserBalance(params?: UserParam) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/countUserBalance',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
15
src/api/system/user/model/count.ts
Normal file
15
src/api/system/user/model/count.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface Count {
|
||||
balance?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserParam extends PageParam {
|
||||
organizationId?: number;
|
||||
}
|
||||
113
src/api/system/user/model/index.ts
Normal file
113
src/api/system/user/model/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { Role } from '../../role/model';
|
||||
import type { Menu } from '../../menu/model';
|
||||
import { Company } from '@/api/system/company/model';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface User {
|
||||
// 账号类型
|
||||
type?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
password2?: string;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 别名
|
||||
alias?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 性别(字典)
|
||||
sex?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 脱敏手机号
|
||||
mobile?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 出生日期
|
||||
birthday?: string;
|
||||
age?: number;
|
||||
// 详细地址
|
||||
address?: string;
|
||||
longitude?: string;
|
||||
latitude?: string;
|
||||
// 会员等级ID
|
||||
gradeId?: number;
|
||||
// 个人简介
|
||||
introduction?: string;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 性别名称
|
||||
sexName?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
// 机构名称
|
||||
organizationName?: string;
|
||||
// 角色列表
|
||||
roles?: Role[];
|
||||
roleCode?: string;
|
||||
// 权限列表
|
||||
authorities?: Menu[];
|
||||
payTime?: string;
|
||||
deliveryTime?: string;
|
||||
receiptTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 租户名称
|
||||
tenantName?: string;
|
||||
logo?: string;
|
||||
companyId?: number;
|
||||
companyInfo?: Company;
|
||||
planId?: number;
|
||||
code?: string;
|
||||
//
|
||||
remember?: boolean;
|
||||
balance?: number;
|
||||
points?: number;
|
||||
payMoney?: number;
|
||||
setting?: string;
|
||||
realName?: string;
|
||||
companyName?: string;
|
||||
gradeName?: string;
|
||||
idCard?: string;
|
||||
comments?: string;
|
||||
recommend?: number;
|
||||
system?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserParam extends PageParam {
|
||||
keywords?: any;
|
||||
type?: any;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
realName?: string;
|
||||
gradeId?: unknown;
|
||||
gradeName?: string;
|
||||
companyName?: string;
|
||||
city?: string;
|
||||
cityMate?: string;
|
||||
sex?: string;
|
||||
phone?: string;
|
||||
status?: number;
|
||||
organizationId?: number;
|
||||
parentId?: number;
|
||||
sexName?: string;
|
||||
roleId?: string;
|
||||
showProfile?: boolean;
|
||||
isStaff?: boolean;
|
||||
}
|
||||
119
src/api/system/version/index.ts
Normal file
119
src/api/system/version/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Version, VersionParam } from './model';
|
||||
import type { Menu } from '../menu/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询角色
|
||||
*/
|
||||
export async function pageVersion(params: VersionParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Version>>>(
|
||||
SERVER_API_URL + '/system/version/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色列表
|
||||
*/
|
||||
export async function listVersion(params?: VersionParam) {
|
||||
const res = await request.get<ApiResult<Version[]>>(
|
||||
SERVER_API_URL + '/system/version',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加角色
|
||||
*/
|
||||
export async function addVersion(data: Version) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/version',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
export async function updateVersion(data: Version) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/version',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
export async function removeVersion(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/version/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除角色
|
||||
*/
|
||||
export async function removeVersions(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/version/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色分配的菜单
|
||||
*/
|
||||
export async function listVersionMenus(versionId?: number) {
|
||||
const res = await request.get<ApiResult<Menu[]>>(
|
||||
SERVER_API_URL + '/system/version-menu/' + versionId
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改角色菜单
|
||||
*/
|
||||
export async function updateVersionMenus(versionId?: number, data?: number[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/version-menu/' + versionId,
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
26
src/api/system/version/model/index.ts
Normal file
26
src/api/system/version/model/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Version {
|
||||
id?: number;
|
||||
versionName?: string;
|
||||
versionCode?: string;
|
||||
vueDownloadUrl?: string;
|
||||
androidDownloadUrl?: string;
|
||||
iosDownloadUrl?: string;
|
||||
updateInfo?: any;
|
||||
isHard?: boolean;
|
||||
isHot?: boolean;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色搜索条件
|
||||
*/
|
||||
export interface VersionParam extends PageParam {
|
||||
versionName?: string;
|
||||
versionCode?: string;
|
||||
comments?: string;
|
||||
}
|
||||
146
src/api/system/white-domain/index.ts
Normal file
146
src/api/system/white-domain/index.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { WhiteDomain, WhiteDomainParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询服务器白名单
|
||||
*/
|
||||
export async function pageWhiteDomain(params: WhiteDomainParam) {
|
||||
const res = await request.get<ApiResult<PageResult<WhiteDomain>>>(
|
||||
SERVER_API_URL + '/system/white-domain/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询服务器白名单列表
|
||||
*/
|
||||
export async function listWhiteDomain(params?: WhiteDomainParam) {
|
||||
const res = await request.get<ApiResult<WhiteDomain[]>>(
|
||||
SERVER_API_URL + '/system/white-domain',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加服务器白名单
|
||||
*/
|
||||
export async function addWhiteDomain(data: WhiteDomain) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/white-domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改服务器白名单
|
||||
*/
|
||||
export async function updateWhiteDomain(data: WhiteDomain) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/white-domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除服务器白名单
|
||||
*/
|
||||
export async function removeWhiteDomain(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/white-domain/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除服务器白名单
|
||||
*/
|
||||
export async function removeBatchWhiteDomain(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/white-domain/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateWhiteDomainStatus(
|
||||
docsId?: number,
|
||||
status?: number
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/white-domain/status',
|
||||
{
|
||||
docsId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询服务器白名单
|
||||
*/
|
||||
export async function getWhiteDomain(id: number) {
|
||||
const res = await request.get<ApiResult<WhiteDomain>>(
|
||||
SERVER_API_URL + '/system/white-domain/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/white-domain/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
27
src/api/system/white-domain/model/index.ts
Normal file
27
src/api/system/white-domain/model/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 服务器白名单
|
||||
*/
|
||||
export interface WhiteDomain {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务器白名单搜索条件
|
||||
*/
|
||||
export interface WhiteDomainParam extends PageParam {
|
||||
id?: number;
|
||||
domain?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user