forked from b2894lxlx/tuanwei-admin
Initial commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { AccessKey, AccessKeyParam } from './model';
|
||||
import { PageResult } from '@/api';
|
||||
|
||||
/**
|
||||
* 查询AccessKey列表
|
||||
*/
|
||||
export async function pageAccessKey(params: AccessKeyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<AccessKey>>>(
|
||||
'/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>>(
|
||||
'/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>>('/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>>(
|
||||
'/system/access-key/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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: '' }
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
export interface Appstore {
|
||||
// 消息id
|
||||
id?: number;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 时间
|
||||
time?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
}
|
||||
Vendored
+67
@@ -0,0 +1,67 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Cache, CacheParam } from './model';
|
||||
|
||||
/**
|
||||
* 查询缓存数据
|
||||
*/
|
||||
export async function listCache(params?: CacheParam) {
|
||||
const res = await request.get<ApiResult<Cache[]>>('/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>>('/system/cache/' + key);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新缓存数据
|
||||
* @param cache
|
||||
*/
|
||||
export async function updateCache(cache: Cache) {
|
||||
const res = await request.post<ApiResult<unknown>>('/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>>('/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>>(
|
||||
'/system/cache/theme',
|
||||
cache
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 缓存管理
|
||||
*/
|
||||
export interface Cache {
|
||||
key?: string;
|
||||
content?: string;
|
||||
expireTime?: number; // 过期时间(秒)
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface CacheParam extends PageParam {
|
||||
key?: string;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Company, CompanyParam } from './model';
|
||||
import { PageResult } from '@/api';
|
||||
|
||||
/**
|
||||
* 查询企业资料
|
||||
*/
|
||||
export async function getCompany(params?: CompanyParam) {
|
||||
const res = await request.get<ApiResult<Company>>('/system/company/profile', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.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>>>(
|
||||
'/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 addCompany(data: Company) {
|
||||
const res = await request.post<ApiResult<unknown>>('/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>>('/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>>('/system/company/' + 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>>(
|
||||
'/system/company/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 企业信息
|
||||
*/
|
||||
export interface Company {
|
||||
companyId?: number;
|
||||
shortName?: string;
|
||||
companyName?: string;
|
||||
companyType?: number;
|
||||
companyLogo?: string;
|
||||
companyCode?: string;
|
||||
domain?: string;
|
||||
phone?: string;
|
||||
InvoiceHeader?: string;
|
||||
startTime?: string;
|
||||
expirationTime?: string;
|
||||
version?: number;
|
||||
members?: number;
|
||||
storage?: string;
|
||||
storageMax?: string;
|
||||
users?: number;
|
||||
departments?: number;
|
||||
industryParent?: string;
|
||||
industryChild?: string;
|
||||
country?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
address?: string;
|
||||
latitude?: string;
|
||||
longitude?: string;
|
||||
comments?: string;
|
||||
authentication?: number;
|
||||
industryId?: number;
|
||||
industryName?: string;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
sortNumber?: number;
|
||||
authoritative?: boolean;
|
||||
tenantId?: number;
|
||||
tenantName?: string;
|
||||
tenantCode?: string;
|
||||
code?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业信息搜索条件
|
||||
*/
|
||||
export interface CompanyParam {
|
||||
companyId?: number;
|
||||
shortName?: string;
|
||||
companyName?: string;
|
||||
domain?: string;
|
||||
keywords?: string;
|
||||
authoritative?: number;
|
||||
authentication?: number;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
version?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DictData, DictDataParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询字典数据
|
||||
*/
|
||||
export async function pageDictData(params: DictDataParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DictData>>>(
|
||||
'/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[]>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/system/dict-data/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
*/
|
||||
export interface DictData {
|
||||
// 字典数据id
|
||||
dictDataId?: number;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
// 字典数据标识
|
||||
dictDataCode?: string;
|
||||
// 字典数据名称
|
||||
dictDataName?: string;
|
||||
// 排序号
|
||||
sortNumber?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典数据搜索条件
|
||||
*/
|
||||
export interface DictDataParam extends PageParam {
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 字典标识
|
||||
dictCode?: string;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Dict, DictParam } from './model';
|
||||
|
||||
/**
|
||||
* 查询字典列表
|
||||
*/
|
||||
export async function listDictionaries(params?: DictParam) {
|
||||
const res = await request.get<ApiResult<Dict[]>>('/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>>('/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>>('/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>>('/system/dict/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { DictionaryData, DictionaryDataParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询字典数据
|
||||
*/
|
||||
export async function pageDictionaryData(params: DictionaryDataParam) {
|
||||
const res = await request.get<ApiResult<PageResult<DictionaryData>>>(
|
||||
'/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[]>>(
|
||||
'/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>>('/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>>('/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>>(
|
||||
'/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>>(
|
||||
'/system/dict-data/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Dictionary, DictionaryParam } from './model';
|
||||
|
||||
/**
|
||||
* 查询字典列表
|
||||
*/
|
||||
export async function listDictionaries(params?: DictionaryParam) {
|
||||
const res = await request.get<ApiResult<Dictionary[]>>('/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>>(
|
||||
'/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>>('/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>>(
|
||||
'/system/dictionary/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { FileRecord, FileRecordParam } from './model';
|
||||
import { FILE_SERVER } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
export async function uploadFile(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
FILE_SERVER + '/api/file/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>>(
|
||||
'/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 pageFiles(params: FileRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<FileRecord>>>(
|
||||
'/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>>('/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>>('/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>>('/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>>('/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>>('/file', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 文件上传记录
|
||||
*/
|
||||
export interface FileRecord {
|
||||
// id
|
||||
id: number;
|
||||
// 文件名称
|
||||
name?: string;
|
||||
// 文件存储路径
|
||||
path?: string;
|
||||
// 文件大小
|
||||
length?: number;
|
||||
// 文件类型
|
||||
contentType?: string;
|
||||
// 上传人id
|
||||
createUserId?: number;
|
||||
// 上传时间
|
||||
createTime?: string;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 文件访问地址
|
||||
url?: string;
|
||||
// 文件缩略图访问地址
|
||||
thumbnail?: string;
|
||||
// 文件下载地址
|
||||
downloadUrl?: string;
|
||||
// 上传人账号
|
||||
createUsername?: string;
|
||||
// 上传人名称
|
||||
createNickname?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传记录查询参数
|
||||
*/
|
||||
export interface FileRecordParam extends PageParam {
|
||||
name?: string;
|
||||
path?: string;
|
||||
contentType?: string;
|
||||
createNickname?: string;
|
||||
count?: number;
|
||||
page?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { LoginRecord, LoginRecordParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询登录日志
|
||||
*/
|
||||
export async function pageLoginRecords(params: LoginRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<LoginRecord>>>(
|
||||
'/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[]>>(
|
||||
'/system/login-record',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Menu, MenuParam } from './model';
|
||||
import { App } from '@/api/dashboard/appstore/model';
|
||||
|
||||
/**
|
||||
* 查询菜单列表
|
||||
*/
|
||||
export async function listMenus(params: MenuParam) {
|
||||
const res = await request.get<ApiResult<Menu[]>>('/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>>('/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>>('/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>>('/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>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/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>>('/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>>(
|
||||
'/system/menu/install/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
export interface Menu {
|
||||
// 菜单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;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 子菜单
|
||||
children?: Menu[];
|
||||
// 权限树回显选中状态, 0未选中, 1选中
|
||||
checked?: boolean;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
value?: number;
|
||||
//
|
||||
parentIds?: number[];
|
||||
//
|
||||
openType?: number;
|
||||
disabled?: boolean;
|
||||
//
|
||||
appId?: number;
|
||||
//
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单搜索参数
|
||||
*/
|
||||
export interface MenuParam {
|
||||
title?: string;
|
||||
path?: string;
|
||||
authority?: string;
|
||||
parentId?: number;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OperationRecord, OperationRecordParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询操作日志
|
||||
*/
|
||||
export async function pageOperationRecords(params: OperationRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OperationRecord>>>(
|
||||
'/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[]>>(
|
||||
'/system/operation-record',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
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;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Organization, OrganizationParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询机构
|
||||
*/
|
||||
export async function pageOrganizations(params: OrganizationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Organization>>>(
|
||||
'/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[]>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/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>>(
|
||||
'/system/organization/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Payment, PaymentParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户
|
||||
*/
|
||||
export async function pagePayment(params: PaymentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Payment>>>(
|
||||
'/shop/payment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户列表
|
||||
*/
|
||||
export async function listPayment(params?: PaymentParam) {
|
||||
const res = await request.get<ApiResult<Payment[]>>('/shop/payment', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户
|
||||
*/
|
||||
export async function addPayment(data: Payment) {
|
||||
const res = await request.post<ApiResult<unknown>>('/shop/payment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户
|
||||
*/
|
||||
export async function updatePayment(data: Payment) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/payment', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户
|
||||
*/
|
||||
export async function removePayment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/payment/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户
|
||||
*/
|
||||
export async function removeBatchPayment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/shop/payment/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>>('/shop/payment/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 alipay(data: PaymentParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/payment/alipay',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户列表
|
||||
*/
|
||||
export async function alipayQuery(orderId) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/shop/payment/mp-alipay/query/' + orderId
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 支付管理
|
||||
*/
|
||||
export interface Payment {
|
||||
paymentId?: number;
|
||||
name?: string;
|
||||
appId?: string;
|
||||
icon?: string;
|
||||
signType?: string;
|
||||
// 公钥
|
||||
alipayPublicKey?: string;
|
||||
privateKey?: string;
|
||||
// 公钥证书
|
||||
appCertPublicKey?: string;
|
||||
alipayCertPublicKey?: string;
|
||||
alipayRootCert?: string;
|
||||
method?: string;
|
||||
isMustTemplate?: number;
|
||||
signMode?: string;
|
||||
templateId?: number;
|
||||
isEnable?: number;
|
||||
isDefault?: number;
|
||||
others?: string;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
config?: string;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付管理搜索条件
|
||||
*/
|
||||
export interface PaymentParam extends PageParam {
|
||||
paymentId?: number;
|
||||
name?: string;
|
||||
method?: string;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Plug, PlugParam } from './model/index';
|
||||
|
||||
/**
|
||||
* 分页查询应用
|
||||
*/
|
||||
export async function pagePlug(params: PlugParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Plug>>>(
|
||||
'/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[]>>('/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>>('/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>>('/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[]>>('/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>>('/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[]>>(
|
||||
'/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>>('/system/plug/plug', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
export interface Plug {
|
||||
plugId?: number;
|
||||
// 菜单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;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Role, RoleParam } from './model';
|
||||
import type { Menu } from '../menu/model';
|
||||
|
||||
/**
|
||||
* 分页查询角色
|
||||
*/
|
||||
export async function pageRoles(params: RoleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Role>>>(
|
||||
'/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[]>>('/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>>('/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>>('/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>>('/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>>('/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[]>>(
|
||||
'/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>>(
|
||||
'/system/role-menu/' + roleId,
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
export interface Role {
|
||||
// 角色id
|
||||
roleId?: number;
|
||||
// 角色标识
|
||||
roleCode?: string;
|
||||
// 角色名称
|
||||
roleName?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色搜索条件
|
||||
*/
|
||||
export interface RoleParam extends PageParam {
|
||||
roleName?: string;
|
||||
roleCode?: string;
|
||||
comments?: string;
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Setting, SettingParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询设置
|
||||
*/
|
||||
export async function pageSetting(params: SettingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Setting>>>(
|
||||
'/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[]>>('/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>>('/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>>('/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>>('/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>>('/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>>(
|
||||
'/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>>(
|
||||
'/system/setting/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
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;
|
||||
|
||||
// 微信公众号/小程序设置
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统设置搜索条件
|
||||
*/
|
||||
export interface SettingParam extends PageParam {
|
||||
settingId?: number;
|
||||
settingKey?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserFile, UserFileParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询用户文件
|
||||
*/
|
||||
export async function pageUserFiles(params: UserFileParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserFile>>>(
|
||||
'/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[]>>('/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>>('/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>>('/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>>(
|
||||
'/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>>(
|
||||
'/system/user-file/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { User, UserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询用户
|
||||
*/
|
||||
export async function pageUsers(params: UserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<User>>>(
|
||||
'/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[]>>('/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[]>>('/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[]>>('/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>>('/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>>('/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>>('/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>>('/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>>('/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>>('/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 updateUserPassword(userId?: number, password = '123456') {
|
||||
const res = await request.put<ApiResult<unknown>>('/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>>(
|
||||
'/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>>('/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>>(
|
||||
'/system/user/countUserBalance',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface Count {
|
||||
balance?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserParam extends PageParam {
|
||||
organizationId?: number;
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
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;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 别名
|
||||
alias?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 性别(字典)
|
||||
sex?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 出生日期
|
||||
birthday?: string;
|
||||
// 详细地址
|
||||
address?: 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[];
|
||||
// 权限列表
|
||||
authorities?: Menu[];
|
||||
payTime?: string;
|
||||
deliveryTime?: string;
|
||||
receiptTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 租户名称
|
||||
tenantName?: string;
|
||||
logo?: string;
|
||||
companyInfo?: Company;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
code?: string;
|
||||
//
|
||||
remember?: boolean;
|
||||
balance?: number;
|
||||
points?: number;
|
||||
payMoney?: number;
|
||||
setting?: string;
|
||||
realName?: string;
|
||||
companyName?: string;
|
||||
idCard?: string;
|
||||
comments?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserParam extends PageParam {
|
||||
type?: any;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
realName?: string;
|
||||
companyName?: string;
|
||||
sex?: string;
|
||||
phone?: string;
|
||||
status?: number;
|
||||
organizationId?: number;
|
||||
parentId?: number;
|
||||
sexName?: string;
|
||||
merchantCode?: string;
|
||||
roleId?: string;
|
||||
isStaff?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user