feat(core): 初始化项目基础架构和CMS功能模块
- 添加Docker相关配置文件(.dockerignore, .env.example, .gitignore) - 实现服务端API代理功能,支持文件、模块和服务器API转发 - 创建文章详情页、栏目文章列表页和单页内容展示页面 - 集成Ant Design Vue组件库并实现SSR样式提取功能 - 定义API响应数据结构类型和应用布局组件 - 开发开发者应用中心和文章管理页面 - 实现CMS导航菜单获取和多租户切换功能
This commit is contained in:
59
app/api/system/access-key/index.ts
Normal file
59
app/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 type { 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.data;
|
||||
}
|
||||
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
app/api/system/access-key/model/index.ts
Normal file
20
app/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
app/api/system/appstore/index.ts
Normal file
11
app/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
app/api/system/appstore/model/index.ts
Normal file
13
app/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
app/api/system/cache/index.ts
vendored
Normal file
76
app/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
app/api/system/cache/model/index.ts
vendored
Normal file
18
app/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
app/api/system/chat/index.ts
Normal file
157
app/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));
|
||||
}
|
||||
49
app/api/system/chat/model/index.ts
Normal file
49
app/api/system/chat/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
status?: number;
|
||||
keywords: string;
|
||||
}
|
||||
106
app/api/system/chatConversation/index.ts
Normal file
106
app/api/system/chatConversation/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ChatConversation, ChatConversationParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询聊天消息表
|
||||
*/
|
||||
export async function pageChatConversation(params: ChatConversationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ChatConversation>>>(
|
||||
MODULES_API_URL + '/shop/chat-conversation/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[]>>(
|
||||
MODULES_API_URL + '/shop/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 addChatConversation(data: ChatConversation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/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: ChatConversation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/chat-conversation',
|
||||
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>>(
|
||||
MODULES_API_URL + '/shop/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>>(
|
||||
MODULES_API_URL + '/shop/chat-conversation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询聊天消息表
|
||||
*/
|
||||
export async function getChatConversation(id: number) {
|
||||
const res = await request.get<ApiResult<ChatConversation>>(
|
||||
MODULES_API_URL + '/shop/chat-conversation/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
app/api/system/chatConversation/model/index.ts
Normal file
37
app/api/system/chatConversation/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 聊天消息表
|
||||
*/
|
||||
export interface ChatConversation {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 好友ID
|
||||
friendId?: number;
|
||||
// 消息类型
|
||||
type?: number;
|
||||
// 消息内容
|
||||
content?: string;
|
||||
// 未读消息
|
||||
unRead?: number;
|
||||
// 状态, 0未读, 1已读
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天消息表搜索条件
|
||||
*/
|
||||
export interface ChatConversationParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
120
app/api/system/chatMessage/index.ts
Normal file
120
app/api/system/chatMessage/index.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ChatMessage, ChatMessageParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询聊天消息表
|
||||
*/
|
||||
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 listChatMessage(params?: ChatMessageParam) {
|
||||
const res = await request.get<ApiResult<ChatMessage[]>>(
|
||||
SERVER_API_URL + '/system/chat-message',
|
||||
{
|
||||
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<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-message',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加聊天消息表
|
||||
*/
|
||||
export async function addBatchChatMessage(data: ChatMessage[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-message/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改聊天消息表
|
||||
*/
|
||||
export async function updateChatMessage(data: ChatMessage) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-message',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除聊天消息表
|
||||
*/
|
||||
export async function removeChatMessage(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-message/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除聊天消息表
|
||||
*/
|
||||
export async function removeBatchChatMessage(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/chat-message/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询聊天消息表
|
||||
*/
|
||||
export async function getChatMessage(id: number) {
|
||||
const res = await request.get<ApiResult<ChatMessage>>(
|
||||
SERVER_API_URL + '/system/chat-message/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
app/api/system/chatMessage/model/index.ts
Normal file
49
app/api/system/chatMessage/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 聊天消息表
|
||||
*/
|
||||
export interface ChatMessage {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 发送人ID
|
||||
formUserId?: number;
|
||||
// 接收人ID
|
||||
toUserId?: number;
|
||||
// 消息类型
|
||||
type?: string;
|
||||
// 消息内容
|
||||
content?: string;
|
||||
// 屏蔽接收方
|
||||
sideTo?: number;
|
||||
// 屏蔽发送方
|
||||
sideFrom?: number;
|
||||
// 是否撤回
|
||||
withdraw?: number;
|
||||
// 文件信息
|
||||
fileInfo?: string;
|
||||
toUserName?: any;
|
||||
formUserName?: string;
|
||||
// 批量发送
|
||||
toUserIds?: any[];
|
||||
// 存在联系方式
|
||||
hasContact?: number;
|
||||
// 状态, 0未读, 1已读
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天消息表搜索条件
|
||||
*/
|
||||
export interface ChatMessageParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
app/api/system/comment/index.ts
Normal file
106
app/api/system/comment/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Comment, CommentParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用评论
|
||||
*/
|
||||
export async function pageComment(params: CommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Comment>>>(
|
||||
SERVER_API_URL + '/system/comment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用评论列表
|
||||
*/
|
||||
export async function listComment(params?: CommentParam) {
|
||||
const res = await request.get<ApiResult<Comment[]>>(
|
||||
SERVER_API_URL + '/system/comment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用评论
|
||||
*/
|
||||
export async function addComment(data: Comment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用评论
|
||||
*/
|
||||
export async function updateComment(data: Comment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用评论
|
||||
*/
|
||||
export async function removeComment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/comment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用评论
|
||||
*/
|
||||
export async function removeBatchComment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/comment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用评论
|
||||
*/
|
||||
export async function getComment(id: number) {
|
||||
const res = await request.get<ApiResult<Comment>>(
|
||||
SERVER_API_URL + '/system/comment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
app/api/system/comment/model/index.ts
Normal file
33
app/api/system/comment/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用评论
|
||||
*/
|
||||
export interface Comment {
|
||||
// ID
|
||||
id?: number;
|
||||
// 父级ID
|
||||
parentId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 评分
|
||||
rate?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 评论内容
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用评论搜索条件
|
||||
*/
|
||||
export interface CommentParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
162
app/api/system/company/index.ts
Normal file
162
app/api/system/company/index.ts
Normal file
@@ -0,0 +1,162 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Company, CompanyParam } from './model';
|
||||
import type { PageResult } from '@/api';
|
||||
import { 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>>(
|
||||
SERVER_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>>>(
|
||||
SERVER_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>>(
|
||||
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 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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CompanyAll
|
||||
*/
|
||||
export async function updateCompanyAll(data: Company) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/updateCompanyAll',
|
||||
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>>(
|
||||
SERVER_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>>(
|
||||
SERVER_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>>(
|
||||
SERVER_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>>(
|
||||
SERVER_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));
|
||||
}
|
||||
187
app/api/system/company/model/index.ts
Normal file
187
app/api/system/company/model/index.ts
Normal file
@@ -0,0 +1,187 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type {Menu} from "@/api/system/menu/model";
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
*/
|
||||
export interface Company {
|
||||
// 企业id
|
||||
companyId?: number;
|
||||
// 应用类型
|
||||
type?: number;
|
||||
// 插件ID
|
||||
menuId?: number;
|
||||
// 企业简称
|
||||
shortName?: string;
|
||||
// 企业全称
|
||||
companyName?: string;
|
||||
// 企业标识
|
||||
companyCode?: string;
|
||||
// 栏目分类
|
||||
categoryId?: number;
|
||||
// 应用截图
|
||||
files?: string;
|
||||
// 类型 10企业 20政府单位
|
||||
companyType?: string;
|
||||
// 企业类型多选(已废弃)
|
||||
companyTypeMultiple?: string;
|
||||
// 应用标识
|
||||
companyLogo?: string;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 应用详情
|
||||
content?: string;
|
||||
// 应用类型
|
||||
appType?: string;
|
||||
// 免费域名
|
||||
freeDomain?: string;
|
||||
// 绑定域名
|
||||
domain?: string;
|
||||
// 联系电话
|
||||
phone?: string;
|
||||
// 座机电话
|
||||
tel?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 发票抬头
|
||||
invoiceHeader?: string;
|
||||
// 企业法人
|
||||
businessEntity?: string;
|
||||
// 服务开始时间
|
||||
startTime?: string;
|
||||
// 服务到期时间
|
||||
expirationTime?: string;
|
||||
// 即将过期
|
||||
soon?: number;
|
||||
// 应用版本 10体验版 20授权版 30永久授权
|
||||
version?: string;
|
||||
// 版本名称
|
||||
versionName?: string;
|
||||
// 版本号
|
||||
versionCode?: string;
|
||||
// 销售价格
|
||||
price?: number;
|
||||
// 计费方式(0免费 1一次性 2按年 3按月 4按天)
|
||||
chargingMethod?: number;
|
||||
// 成员数量(人数上限)
|
||||
members?: number;
|
||||
// 成员数量(当前)
|
||||
users?: number;
|
||||
// 行业类型(父级)
|
||||
industryParent?: string;
|
||||
// 行业类型(子级)
|
||||
industryChild?: string;
|
||||
// 部门数量
|
||||
departments?: number;
|
||||
// 存储空间
|
||||
storage?: string;
|
||||
// 存储空间(上限)
|
||||
storageMax?: string;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 详细
|
||||
lngAndLat?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否实名认证
|
||||
authentication?: number;
|
||||
// 企业默认主体
|
||||
authoritative?: boolean;
|
||||
// 主控节点
|
||||
serverUrl?: string;
|
||||
// 模块节点
|
||||
modulesUrl?: string;
|
||||
// 重定向
|
||||
redirectUrl?: string;
|
||||
// request合法域名
|
||||
requestUrl?: string;
|
||||
// socket合法域名
|
||||
socketUrl?: string;
|
||||
// 总后台管理入口
|
||||
adminUrl?: string;
|
||||
// 商户端入口
|
||||
merchantUrl?: string;
|
||||
// 网站域名
|
||||
websiteUrl?: string;
|
||||
// 微信小程序二维码
|
||||
mpWeixinCode?: string;
|
||||
// 支付宝小程序二维码
|
||||
mpAlipayCode?: string;
|
||||
// H5端应用二维码
|
||||
h5Code?: string;
|
||||
// 安卓APP二维码
|
||||
androidUrl?: string;
|
||||
// 苹果APP二维码
|
||||
iosUrl?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 点赞数量
|
||||
likes?: number;
|
||||
// 点击数量
|
||||
clicks?: number;
|
||||
// 购买数量
|
||||
buys?: number;
|
||||
// 评分
|
||||
rate?: number;
|
||||
// 是否含税, 0不含, 1含
|
||||
isTax?: number;
|
||||
// 当前克隆的租户ID
|
||||
planId?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 是否隐藏
|
||||
hide?: boolean;
|
||||
// 是否开启网站
|
||||
websiteStatus?: boolean;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 租户id
|
||||
tid?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 是否官方自营
|
||||
official?: boolean;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 租户名称
|
||||
tenantName?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 权限
|
||||
authorities?: Menu[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业信息搜索条件
|
||||
*/
|
||||
export interface CompanyParam extends PageParam {
|
||||
companyId?: number;
|
||||
phone?: string;
|
||||
userId?: string;
|
||||
type?: number;
|
||||
tenantId?: number;
|
||||
version?: number;
|
||||
shortName?: string;
|
||||
companyName?: string;
|
||||
official?: boolean;
|
||||
deleted?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
app/api/system/companyComment/index.ts
Normal file
106
app/api/system/companyComment/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {CompanyComment, CompanyCommentParam} from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用评论
|
||||
*/
|
||||
export async function pageCompanyComment(params: CompanyCommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CompanyComment>>>(
|
||||
SERVER_API_URL + '/system/company-comment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用评论列表
|
||||
*/
|
||||
export async function listCompanyComment(params?: CompanyCommentParam) {
|
||||
const res = await request.get<ApiResult<CompanyComment[]>>(
|
||||
SERVER_API_URL + '/system/company-comment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用评论
|
||||
*/
|
||||
export async function addCompanyComment(data: CompanyComment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用评论
|
||||
*/
|
||||
export async function updateCompanyComment(data: CompanyComment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用评论
|
||||
*/
|
||||
export async function removeCompanyComment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用评论
|
||||
*/
|
||||
export async function removeBatchCompanyComment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-comment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用评论
|
||||
*/
|
||||
export async function getCompanyComment(id: number) {
|
||||
const res = await request.get<ApiResult<CompanyComment>>(
|
||||
SERVER_API_URL + '/system/company-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
app/api/system/companyComment/model/index.ts
Normal file
35
app/api/system/companyComment/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用评论
|
||||
*/
|
||||
export interface CompanyComment {
|
||||
// ID
|
||||
id?: number;
|
||||
// 父级ID
|
||||
parentId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 评分
|
||||
rate?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 评论内容
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用评论搜索条件
|
||||
*/
|
||||
export interface CompanyCommentParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
121
app/api/system/companyContent/index.ts
Normal file
121
app/api/system/companyContent/index.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CompanyContent, CompanyContentParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用详情
|
||||
*/
|
||||
export async function pageCompanyContent(params: CompanyContentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CompanyContent>>>(
|
||||
SERVER_API_URL + '/system/company-content/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用详情列表
|
||||
*/
|
||||
export async function listCompanyContent(params?: CompanyContentParam) {
|
||||
const res = await request.get<ApiResult<CompanyContent[]>>(
|
||||
SERVER_API_URL + '/system/company-content',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用详情
|
||||
* @param id
|
||||
*/
|
||||
export async function getByCompanyId(id: number) {
|
||||
const res = await request.get<ApiResult<CompanyContent>>(
|
||||
SERVER_API_URL + '/system/company-content/getByCompanyId/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加应用详情
|
||||
*/
|
||||
export async function addCompanyContent(data: CompanyContent) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用详情
|
||||
*/
|
||||
export async function updateCompanyContent(data: CompanyContent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-content',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用详情
|
||||
*/
|
||||
export async function removeCompanyContent(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-content/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用详情
|
||||
*/
|
||||
export async function removeBatchCompanyContent(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-content/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用详情
|
||||
*/
|
||||
export async function getCompanyContent(id: number) {
|
||||
const res = await request.get<ApiResult<CompanyContent>>(
|
||||
SERVER_API_URL + '/system/company-content/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
app/api/system/companyContent/model/index.ts
Normal file
25
app/api/system/companyContent/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用详情
|
||||
*/
|
||||
export interface CompanyContent {
|
||||
//
|
||||
id?: number;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 详细内容
|
||||
content?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用详情搜索条件
|
||||
*/
|
||||
export interface CompanyContentParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
app/api/system/companyGit/index.ts
Normal file
106
app/api/system/companyGit/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CompanyGit, CompanyGitParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询代码仓库
|
||||
*/
|
||||
export async function pageCompanyGit(params: CompanyGitParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CompanyGit>>>(
|
||||
SERVER_API_URL + '/system/company-git/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代码仓库列表
|
||||
*/
|
||||
export async function listCompanyGit(params?: CompanyGitParam) {
|
||||
const res = await request.get<ApiResult<CompanyGit[]>>(
|
||||
SERVER_API_URL + '/system/company-git',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加代码仓库
|
||||
*/
|
||||
export async function addCompanyGit(data: CompanyGit) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-git',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代码仓库
|
||||
*/
|
||||
export async function updateCompanyGit(data: CompanyGit) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-git',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代码仓库
|
||||
*/
|
||||
export async function removeCompanyGit(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-git/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代码仓库
|
||||
*/
|
||||
export async function removeBatchCompanyGit(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-git/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询代码仓库
|
||||
*/
|
||||
export async function getCompanyGit(id: number) {
|
||||
const res = await request.get<ApiResult<CompanyGit>>(
|
||||
SERVER_API_URL + '/system/company-git/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
app/api/system/companyGit/model/index.ts
Normal file
41
app/api/system/companyGit/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 代码仓库
|
||||
*/
|
||||
export interface CompanyGit {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 仓库名称
|
||||
title?: string;
|
||||
// 厂商 0私有仓库 1github 2gitee 3其他
|
||||
brand?: string;
|
||||
// 语言
|
||||
language?: string;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 仓库地址
|
||||
domain?: string;
|
||||
// 账号
|
||||
account?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 仓库描述
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代码仓库搜索条件
|
||||
*/
|
||||
export interface CompanyGitParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
app/api/system/companyParameter/index.ts
Normal file
106
app/api/system/companyParameter/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CompanyParameter, CompanyParameterParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用参数
|
||||
*/
|
||||
export async function pageCompanyParameter(params: CompanyParameterParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CompanyParameter>>>(
|
||||
SERVER_API_URL + '/system/company-parameter/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用参数列表
|
||||
*/
|
||||
export async function listCompanyParameter(params?: CompanyParameterParam) {
|
||||
const res = await request.get<ApiResult<CompanyParameter[]>>(
|
||||
SERVER_API_URL + '/system/company-parameter',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用参数
|
||||
*/
|
||||
export async function addCompanyParameter(data: CompanyParameter) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-parameter',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用参数
|
||||
*/
|
||||
export async function updateCompanyParameter(data: CompanyParameter) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-parameter',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用参数
|
||||
*/
|
||||
export async function removeCompanyParameter(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-parameter/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用参数
|
||||
*/
|
||||
export async function removeBatchCompanyParameter(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-parameter/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用参数
|
||||
*/
|
||||
export async function getCompanyParameter(id: number) {
|
||||
const res = await request.get<ApiResult<CompanyParameter>>(
|
||||
SERVER_API_URL + '/system/company-parameter/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
app/api/system/companyParameter/model/index.ts
Normal file
33
app/api/system/companyParameter/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用参数
|
||||
*/
|
||||
export interface CompanyParameter {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 参数名称
|
||||
name?: string;
|
||||
// 参数内容
|
||||
value?: string;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用参数搜索条件
|
||||
*/
|
||||
export interface CompanyParameterParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
app/api/system/companyUrl/index.ts
Normal file
106
app/api/system/companyUrl/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CompanyUrl, CompanyUrlParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用域名
|
||||
*/
|
||||
export async function pageCompanyUrl(params: CompanyUrlParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CompanyUrl>>>(
|
||||
SERVER_API_URL + '/system/company-url/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用域名列表
|
||||
*/
|
||||
export async function listCompanyUrl(params?: CompanyUrlParam) {
|
||||
const res = await request.get<ApiResult<CompanyUrl[]>>(
|
||||
SERVER_API_URL + '/system/company-url',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用域名
|
||||
*/
|
||||
export async function addCompanyUrl(data: CompanyUrl) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用域名
|
||||
*/
|
||||
export async function updateCompanyUrl(data: CompanyUrl) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用域名
|
||||
*/
|
||||
export async function removeCompanyUrl(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-url/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用域名
|
||||
*/
|
||||
export async function removeBatchCompanyUrl(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company-url/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用域名
|
||||
*/
|
||||
export async function getCompanyUrl(id: number) {
|
||||
const res = await request.get<ApiResult<CompanyUrl>>(
|
||||
SERVER_API_URL + '/system/company-url/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
app/api/system/companyUrl/model/index.ts
Normal file
39
app/api/system/companyUrl/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用域名
|
||||
*/
|
||||
export interface CompanyUrl {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 域名类型
|
||||
type?: string;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 账号
|
||||
account?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 二维码
|
||||
qrcode?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用域名搜索条件
|
||||
*/
|
||||
export interface CompanyUrlParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
87
app/api/system/dict-data/index.ts
Normal file
87
app/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));
|
||||
}
|
||||
49
app/api/system/dict-data/model/index.ts
Normal file
49
app/api/system/dict-data/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
*/
|
||||
export interface DictData {
|
||||
// 字典数据id
|
||||
dictDataId?: number;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
// 字典名称
|
||||
dictName?: string;
|
||||
// 字典数据标识
|
||||
dictDataCode?: string;
|
||||
// 字典数据名称
|
||||
dictDataName?: string;
|
||||
// 预设字段(路由地址)
|
||||
path?: string;
|
||||
// 预设字段(组件路径)
|
||||
component?: 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
app/api/system/dict/index.ts
Normal file
61
app/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
app/api/system/dict/model/index.ts
Normal file
29
app/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
app/api/system/dictionary-data/index.ts
Normal file
87
app/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/dictionary-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/dictionary-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/dictionary-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/dictionary-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/dictionary-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/dictionary-data/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
app/api/system/dictionary-data/model/index.ts
Normal file
37
app/api/system/dictionary-data/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 字典数据
|
||||
*/
|
||||
export interface DictionaryData {
|
||||
// 字典数据id
|
||||
dictDataId?: number;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
// 字典数据标识
|
||||
dictDataCode?: string;
|
||||
// 字典数据名称
|
||||
dictDataName?: string;
|
||||
// 预设字段(路由地址)
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典数据搜索条件
|
||||
*/
|
||||
export interface DictionaryDataParam extends PageParam {
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 字典标识
|
||||
dictCode?: string;
|
||||
// 字典id
|
||||
dictId?: number;
|
||||
}
|
||||
61
app/api/system/dictionary/index.ts
Normal file
61
app/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
app/api/system/dictionary/model/index.ts
Normal file
29
app/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;
|
||||
}
|
||||
119
app/api/system/domain/index.ts
Normal file
119
app/api/system/domain/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Domain, DomainParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询授权域名
|
||||
*/
|
||||
export async function pageDomain(params: DomainParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Domain>>>(
|
||||
SERVER_API_URL + '/system/domain/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询授权域名列表
|
||||
*/
|
||||
export async function listDomain(params?: DomainParam) {
|
||||
const res = await request.get<ApiResult<Domain[]>>(
|
||||
SERVER_API_URL + '/system/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 addDomain(data: Domain) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改授权域名
|
||||
*/
|
||||
export async function updateDomain(data: Domain) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除授权域名
|
||||
*/
|
||||
export async function removeDomain(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/domain/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除授权域名
|
||||
*/
|
||||
export async function removeBatchDomain(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/domain/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询授权域名
|
||||
*/
|
||||
export async function getDomain(id: number) {
|
||||
const res = await request.get<ApiResult<Domain>>(
|
||||
SERVER_API_URL + '/system/domain/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据域名查询授权
|
||||
*/
|
||||
export async function getByDomain(domain: string) {
|
||||
const res = await request.get<ApiResult<Domain>>(
|
||||
SERVER_API_URL + '/system/domain/getByDomain/' + domain
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
38
app/api/system/domain/model/index.ts
Normal file
38
app/api/system/domain/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 授权域名
|
||||
*/
|
||||
export interface Domain {
|
||||
// ID
|
||||
id?: number;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 主机记录
|
||||
hostName?: string;
|
||||
// 记录值
|
||||
hostValue?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
comments?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权域名搜索条件
|
||||
*/
|
||||
export interface DomainParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
125
app/api/system/environment/index.ts
Normal file
125
app/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
app/api/system/environment/model/index.ts
Normal file
25
app/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;
|
||||
}
|
||||
250
app/api/system/file/index.ts
Normal file
250
app/api/system/file/index.ts
Normal file
@@ -0,0 +1,250 @@
|
||||
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 uploadOssAvatar(file: File, fileName: string) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file, fileName);
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传阿里云OSS
|
||||
*/
|
||||
export async function uploadOssByAppId(file: File, appId: string) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<FileRecord>>(
|
||||
SERVER_API_URL + '/oss/upload',
|
||||
formData,
|
||||
{
|
||||
headers: { appId }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
app/api/system/file/model/index.ts
Normal file
55
app/api/system/file/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
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;
|
||||
// 商品SKU索引
|
||||
index?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传记录查询参数
|
||||
*/
|
||||
export interface FileRecordParam extends PageParam {
|
||||
name?: string;
|
||||
path?: string;
|
||||
contentType?: string;
|
||||
createNickname?: string;
|
||||
groupId?: number;
|
||||
groupName?: string;
|
||||
count?: number;
|
||||
page?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
32
app/api/system/login-record/index.ts
Normal file
32
app/api/system/login-record/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { LoginRecord, LoginRecordParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询登录日志
|
||||
*/
|
||||
export async function pageLoginRecords(params: LoginRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<LoginRecord>>>(
|
||||
SERVER_API_URL + '/system/login-record/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询登录日志列表
|
||||
*/
|
||||
export async function listLoginRecords(params?: LoginRecordParam) {
|
||||
const res = await request.get<ApiResult<LoginRecord[]>>(
|
||||
SERVER_API_URL + '/system/login-record',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
38
app/api/system/login-record/model/index.ts
Normal file
38
app/api/system/login-record/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 登录日志
|
||||
*/
|
||||
export interface LoginRecord {
|
||||
// 登录日志id
|
||||
id: number;
|
||||
// 用户账号
|
||||
username: string;
|
||||
// 操作系统
|
||||
os: string;
|
||||
// 设备名称
|
||||
device: string;
|
||||
// 浏览器类型
|
||||
browser: string;
|
||||
// ip地址
|
||||
ip: string;
|
||||
// 操作类型, 0登录成功, 1登录失败, 2退出登录, 3续签token
|
||||
loginType: number;
|
||||
// 备注
|
||||
comments: string;
|
||||
// 操作时间
|
||||
createTime: string;
|
||||
// 用户昵称
|
||||
nickname: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录日志搜索条件
|
||||
*/
|
||||
export interface LoginRecordParam extends PageParam {
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
loginType?: number;
|
||||
}
|
||||
172
app/api/system/menu/index.ts
Normal file
172
app/api/system/menu/index.ts
Normal file
@@ -0,0 +1,172 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Menu, MenuParam } from './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 removeBatchMenu(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按顶级目录批量删除菜单
|
||||
*/
|
||||
export async function deleteParentMenu(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/deleteParentMenu/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 安装应用
|
||||
*/
|
||||
export async function installApp(data: any) {
|
||||
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: any) {
|
||||
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: any) {
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入备份
|
||||
*/
|
||||
export async function importSystemMenu(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/menu/import',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
67
app/api/system/menu/model/index.ts
Normal file
67
app/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
app/api/system/modules/index.ts
Normal file
118
app/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
app/api/system/modules/model/index.ts
Normal file
22
app/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
app/api/system/operation-record/index.ts
Normal file
32
app/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
app/api/system/operation-record/model/index.ts
Normal file
56
app/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;
|
||||
}
|
||||
106
app/api/system/order/index.ts
Normal file
106
app/api/system/order/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Order, OrderParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageOrder(params: OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Order>>>(
|
||||
SERVER_API_URL + '/system/order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listOrder(params?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
SERVER_API_URL + '/system/order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addOrder(data: Order) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateOrder(data: Order) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询订单
|
||||
*/
|
||||
export async function getOrder(id: number) {
|
||||
const res = await request.get<ApiResult<Order>>(
|
||||
SERVER_API_URL + '/system/order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
98
app/api/system/order/model/index.ts
Normal file
98
app/api/system/order/model/index.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface Order {
|
||||
// 订单号
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单类型,0产品 1插件
|
||||
type?: number;
|
||||
// 下单渠道,0网站 1小程序 2其他
|
||||
channel?: number;
|
||||
// 微信支付订单号
|
||||
transactionId?: string;
|
||||
// 微信退款订单号
|
||||
refundOrder?: string;
|
||||
// 使用的优惠券id
|
||||
couponId?: number;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 订单总额
|
||||
totalPrice?: string;
|
||||
// 减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
|
||||
reducePrice?: string;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 用于统计
|
||||
price?: string;
|
||||
// 价钱,用于积分赠送
|
||||
money?: string;
|
||||
// 退款金额
|
||||
refundMoney?: string;
|
||||
// 购买数量
|
||||
totalNum?: number;
|
||||
// 0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机
|
||||
payType?: number;
|
||||
// 0未付款,1已付款
|
||||
payStatus?: number;
|
||||
// 0未完成,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: number;
|
||||
// 优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
|
||||
couponType?: number;
|
||||
// 优惠说明
|
||||
couponDesc?: string;
|
||||
// 二维码地址,保存订单号,支付成功后才生成
|
||||
qrcode?: string;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:0未开发票,1已开发票,2不能开具发票
|
||||
isInvoice?: string;
|
||||
// 发票流水号
|
||||
invoiceNo?: string;
|
||||
// 支付时间
|
||||
payTime?: string;
|
||||
// 退款时间
|
||||
refundTime?: string;
|
||||
// 申请退款时间
|
||||
refundApplyTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
// 订单是否已结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 系统版本号 0当前版本 value=其他版本
|
||||
version?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface OrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
type?: number;
|
||||
payStatus?: number;
|
||||
payType?: number;
|
||||
isInvoice?: string;
|
||||
week?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
106
app/api/system/orderGoods/index.ts
Normal file
106
app/api/system/orderGoods/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderGoods, OrderGoodsParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单商品
|
||||
*/
|
||||
export async function pageOrderGoods(params: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderGoods>>>(
|
||||
SERVER_API_URL + '/system/order-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单商品列表
|
||||
*/
|
||||
export async function listOrderGoods(params?: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<OrderGoods[]>>(
|
||||
SERVER_API_URL + '/system/order-goods',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单商品
|
||||
*/
|
||||
export async function addOrderGoods(data: OrderGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单商品
|
||||
*/
|
||||
export async function updateOrderGoods(data: OrderGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单商品
|
||||
*/
|
||||
export async function removeOrderGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单商品
|
||||
*/
|
||||
export async function removeBatchOrderGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/order-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询订单商品
|
||||
*/
|
||||
export async function getOrderGoods(id: number) {
|
||||
const res = await request.get<ApiResult<OrderGoods>>(
|
||||
SERVER_API_URL + '/system/order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
app/api/system/orderGoods/model/index.ts
Normal file
57
app/api/system/orderGoods/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单商品
|
||||
*/
|
||||
export interface OrderGoods {
|
||||
// 订单号
|
||||
id?: number;
|
||||
// 订单类型,0商城 1应用插件
|
||||
type?: number;
|
||||
// 项目ID
|
||||
itemId?: number;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 购买数量
|
||||
totalNum?: number;
|
||||
// 0未付款,1已付款
|
||||
payStatus?: string;
|
||||
// 0未完成,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: number;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:0未开发票,1已开发票,2不能开具发票
|
||||
isInvoice?: string;
|
||||
// 发票流水号
|
||||
invoiceNo?: string;
|
||||
// 支付时间
|
||||
payTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单商品搜索条件
|
||||
*/
|
||||
export interface OrderGoodsParam extends PageParam {
|
||||
id?: number;
|
||||
itemId?: number;
|
||||
payStatus?: boolean;
|
||||
userId?: number;
|
||||
orderStatus?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
73
app/api/system/organization/index.ts
Normal file
73
app/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
app/api/system/organization/model/index.ts
Normal file
42
app/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;
|
||||
}
|
||||
106
app/api/system/parameter/index.ts
Normal file
106
app/api/system/parameter/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Parameter, ParameterParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用参数
|
||||
*/
|
||||
export async function pageParameter(params: ParameterParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Parameter>>>(
|
||||
SERVER_API_URL + '/system/parameter/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用参数列表
|
||||
*/
|
||||
export async function listParameter(params?: ParameterParam) {
|
||||
const res = await request.get<ApiResult<Parameter[]>>(
|
||||
SERVER_API_URL + '/system/parameter',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用参数
|
||||
*/
|
||||
export async function addParameter(data: Parameter) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/parameter',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用参数
|
||||
*/
|
||||
export async function updateParameter(data: Parameter) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/parameter',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用参数
|
||||
*/
|
||||
export async function removeParameter(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/parameter/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用参数
|
||||
*/
|
||||
export async function removeBatchParameter(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/parameter/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用参数
|
||||
*/
|
||||
export async function getParameter(id: number) {
|
||||
const res = await request.get<ApiResult<Parameter>>(
|
||||
SERVER_API_URL + '/system/parameter/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
app/api/system/parameter/model/index.ts
Normal file
31
app/api/system/parameter/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用参数
|
||||
*/
|
||||
export interface Parameter {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 参数名称
|
||||
name?: string;
|
||||
// 参数内容
|
||||
value?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用参数搜索条件
|
||||
*/
|
||||
export interface ParameterParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
178
app/api/system/payment/index.ts
Normal file
178
app/api/system/payment/index.ts
Normal file
@@ -0,0 +1,178 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Payment, PaymentParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
import type { Order } from '@/api/system/order/model';
|
||||
|
||||
export type PaymentCreatePayload = Record<string, unknown>;
|
||||
|
||||
export type PaymentCreateResult = {
|
||||
codeUrl?: string;
|
||||
url?: string;
|
||||
payUrl?: string;
|
||||
paymentUrl?: string;
|
||||
qrcode?: string;
|
||||
orderId?: number;
|
||||
orderNo?: string;
|
||||
paymentNo?: string;
|
||||
tradeNo?: string;
|
||||
order?: Order;
|
||||
} & Record<string, unknown>;
|
||||
|
||||
/**
|
||||
* 分页查询支付方式
|
||||
*/
|
||||
export async function pagePayment(params: PaymentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Payment>>>(
|
||||
SERVER_API_URL + '/system/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[]>>(
|
||||
SERVER_API_URL + '/system/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>>(
|
||||
SERVER_API_URL + '/system/payment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一下单订单接口
|
||||
*/
|
||||
export async function create(data: PaymentCreatePayload) {
|
||||
const res = await request.post<ApiResult<PaymentCreateResult>>(
|
||||
SERVER_API_URL + '/system/payment/create',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一下单订单接口(包含订单信息)
|
||||
*/
|
||||
export async function createWithOrder(data: PaymentCreatePayload) {
|
||||
try {
|
||||
const res = await request.post<ApiResult<PaymentCreateResult>>(
|
||||
SERVER_API_URL + '/system/payment/createWithOrder',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
} catch (e: any) {
|
||||
const status = e?.statusCode ?? e?.response?.status;
|
||||
if (String(status) !== '404') throw e;
|
||||
|
||||
const res = await request.post<ApiResult<PaymentCreateResult>>(
|
||||
SERVER_API_URL + '/system/payment/create-with-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支付方式
|
||||
*/
|
||||
export async function updatePayment(data: Payment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/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>>(
|
||||
SERVER_API_URL + '/system/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>>(
|
||||
SERVER_API_URL + '/system/payment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询支付方式
|
||||
*/
|
||||
export async function getPayment(id: number) {
|
||||
const res = await request.get<ApiResult<Payment>>(
|
||||
SERVER_API_URL + '/system/payment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成支付二维码(微信native)
|
||||
*/
|
||||
export async function getNativeCode(data: Order) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/wx-native-pay/codeUrl',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
59
app/api/system/payment/model/index.ts
Normal file
59
app/api/system/payment/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
*/
|
||||
export interface Payment {
|
||||
// ID
|
||||
id?: number;
|
||||
// 支付方式
|
||||
name?: string;
|
||||
// 支付类型
|
||||
type?: number;
|
||||
// 标识
|
||||
code?: string;
|
||||
// 支付图标
|
||||
image?: string;
|
||||
// 微信商户号类型 1普通商户2子商户
|
||||
wechatType?: number;
|
||||
// 应用ID
|
||||
appId?: string;
|
||||
// 商户号
|
||||
mchId?: string;
|
||||
// 设置APIv3密钥
|
||||
apiKey?: string;
|
||||
// 证书文件 (CERT)
|
||||
apiclientCert?: string;
|
||||
// 证书文件 (KEY)
|
||||
apiclientKey?: string;
|
||||
// 商户证书序列号
|
||||
merchantSerialNumber?: string;
|
||||
// 支付宝公钥
|
||||
pubKey?: string;
|
||||
// 支付宝公钥ID
|
||||
pubKeyId?: string;
|
||||
// 支付结果通过
|
||||
notifyUrl?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 文章排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0启用, 1禁用
|
||||
status?: boolean;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付方式搜索条件
|
||||
*/
|
||||
export interface PaymentParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
125
app/api/system/plug/index.ts
Normal file
125
app/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
app/api/system/plug/model/index.ts
Normal file
67
app/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
app/api/system/role/index.ts
Normal file
119
app/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
app/api/system/role/model/index.ts
Normal file
27
app/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;
|
||||
}
|
||||
153
app/api/system/setting/index.ts
Normal file
153
app/api/system/setting/index.ts
Normal file
@@ -0,0 +1,153 @@
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key查询
|
||||
*/
|
||||
export async function getSettingByKey(key: string) {
|
||||
const res = await request.get<ApiResult<any>>(
|
||||
SERVER_API_URL + '/system/setting/getByKey/' + key
|
||||
);
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据Key修改设置
|
||||
*/
|
||||
export async function updateSettingByKey(data: Setting) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/setting/updateByKey',
|
||||
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
app/api/system/setting/model/index.ts
Normal file
127
app/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;
|
||||
}
|
||||
201
app/api/system/tenant/index.ts
Normal file
201
app/api/system/tenant/index.ts
Normal file
@@ -0,0 +1,201 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Tenant, TenantParam } from './model';
|
||||
import type { Menu } from '@/api/system/menu/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
type TenantRequestOptions = {
|
||||
headers?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
/**
|
||||
* 分页查询租户
|
||||
*/
|
||||
export async function pageTenant(params: TenantParam, options: TenantRequestOptions = {}) {
|
||||
// 租户列表查询需要传一个key
|
||||
// params.tenantCode = 'ZAcxbdmDQFwUKC3e';
|
||||
const res = await request.get<ApiResult<PageResult<Tenant>>>(
|
||||
SERVER_API_URL + '/system/tenant/page',
|
||||
{
|
||||
params,
|
||||
headers: options.headers
|
||||
}
|
||||
);
|
||||
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, options: TenantRequestOptions = {}) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant',
|
||||
data,
|
||||
{ headers: options.headers }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改租户
|
||||
*/
|
||||
export async function updateTenant(data: Tenant, options: TenantRequestOptions = {}) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant',
|
||||
data,
|
||||
{ headers: options.headers }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除租户
|
||||
*/
|
||||
export async function removeTenant(id?: number, options: TenantRequestOptions = {}) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant/' + id,
|
||||
{ headers: options.headers }
|
||||
);
|
||||
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',
|
||||
options: TenantRequestOptions = {}
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/tenant/password',
|
||||
{
|
||||
tenantId,
|
||||
password
|
||||
},
|
||||
{ headers: options.headers }
|
||||
);
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code查询租户
|
||||
*/
|
||||
export async function getByCode(code: string) {
|
||||
const res = await request.get<any>(
|
||||
SERVER_API_URL + '/system/tenant/getByCode/' + code
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
app/api/system/tenant/model/index.ts
Normal file
47
app/api/system/tenant/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { 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;
|
||||
userId?: number;
|
||||
companyId?: number;
|
||||
companyName?: string;
|
||||
version?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
tenantCode?: string;
|
||||
}
|
||||
106
app/api/system/url/index.ts
Normal file
106
app/api/system/url/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Url, UrlParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询应用域名
|
||||
*/
|
||||
export async function pageUrl(params: UrlParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Url>>>(
|
||||
SERVER_API_URL + '/system/url/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询应用域名列表
|
||||
*/
|
||||
export async function listUrl(params?: UrlParam) {
|
||||
const res = await request.get<ApiResult<Url[]>>(
|
||||
SERVER_API_URL + '/system/url',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加应用域名
|
||||
*/
|
||||
export async function addUrl(data: Url) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改应用域名
|
||||
*/
|
||||
export async function updateUrl(data: Url) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/url',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除应用域名
|
||||
*/
|
||||
export async function removeUrl(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/url/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除应用域名
|
||||
*/
|
||||
export async function removeBatchUrl(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/url/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询应用域名
|
||||
*/
|
||||
export async function getUrl(id: number) {
|
||||
const res = await request.get<ApiResult<Url>>(
|
||||
SERVER_API_URL + '/system/url/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
app/api/system/url/model/index.ts
Normal file
37
app/api/system/url/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 应用域名
|
||||
*/
|
||||
export interface Url {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 域名类型
|
||||
type?: string;
|
||||
// 域名
|
||||
domain?: string;
|
||||
// 账号
|
||||
account?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 二维码
|
||||
qrcode?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1待确认
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用域名搜索条件
|
||||
*/
|
||||
export interface UrlParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
app/api/system/user-collection/index.ts
Normal file
106
app/api/system/user-collection/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCollection, UserCollectionParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询我的收藏
|
||||
*/
|
||||
export async function pageUserCollection(params: UserCollectionParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCollection>>>(
|
||||
SERVER_API_URL + '/system/user-collection/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的收藏列表
|
||||
*/
|
||||
export async function listUserCollection(params?: UserCollectionParam) {
|
||||
const res = await request.get<ApiResult<UserCollection[]>>(
|
||||
SERVER_API_URL + '/system/user-collection',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加我的收藏
|
||||
*/
|
||||
export async function addUserCollection(data: UserCollection) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-collection',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改我的收藏
|
||||
*/
|
||||
export async function updateUserCollection(data: UserCollection) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-collection',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除我的收藏
|
||||
*/
|
||||
export async function removeUserCollection(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-collection/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除我的收藏
|
||||
*/
|
||||
export async function removeBatchUserCollection(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-collection/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询我的收藏
|
||||
*/
|
||||
export async function getUserCollection(id: number) {
|
||||
const res = await request.get<ApiResult<UserCollection>>(
|
||||
SERVER_API_URL + '/system/user-collection/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
app/api/system/user-collection/model/index.ts
Normal file
25
app/api/system/user-collection/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 我的收藏
|
||||
*/
|
||||
export interface UserCollection {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 租户ID
|
||||
tid?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的收藏搜索条件
|
||||
*/
|
||||
export interface UserCollectionParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
89
app/api/system/user-file/index.ts
Normal file
89
app/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
app/api/system/user-file/model/index.ts
Normal file
39
app/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
app/api/system/user-grade/index.ts
Normal file
120
app/api/system/user-grade/index.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Grade, GradeParam } from '@/api/user/grade/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageGrade(params: GradeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Grade>>>(
|
||||
SERVER_API_URL + '/system/user-grade/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listGrade(params?: GradeParam) {
|
||||
const res = await request.get<ApiResult<Grade[]>>(
|
||||
SERVER_API_URL + '/system/user-grade',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addGrade(data: Grade) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateGrade(data: Grade) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindGrade(data: Grade) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchGrade(data: Grade[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeGrade(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchGrade(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-grade/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
28
app/api/system/user-grade/model/index.ts
Normal file
28
app/api/system/user-grade/model/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Grade {
|
||||
gradeId?: number;
|
||||
name?: string;
|
||||
weight?: string;
|
||||
upgrade?: string;
|
||||
equity?: string;
|
||||
commission?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface GradeParam extends PageParam {
|
||||
gradeId?: number;
|
||||
name?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
120
app/api/system/user-group/index.ts
Normal file
120
app/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
app/api/system/user-group/model/index.ts
Normal file
23
app/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;
|
||||
}
|
||||
298
app/api/system/user/index.ts
Normal file
298
app/api/system/user/index.ts
Normal file
@@ -0,0 +1,298 @@
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加管理员用户
|
||||
* @param data
|
||||
*/
|
||||
export async function addAdminUser(data: User) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user/addAdminUser',
|
||||
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: any) {
|
||||
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 importShopAdmins(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/admin/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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择管理员账号登录
|
||||
* @param params
|
||||
*/
|
||||
export async function listAdminsByPhoneAll(params?: UserParam){
|
||||
const res = await request.get<ApiResult<User[]>>(
|
||||
SERVER_API_URL + '/system/user/listAdminsByPhoneAll',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户列表
|
||||
*/
|
||||
export async function exportUsers(params?: UserParam) {
|
||||
const res = await request.get<Blob>(
|
||||
SERVER_API_URL + '/system/user/export',
|
||||
{
|
||||
params,
|
||||
responseType: 'blob'
|
||||
}
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
15
app/api/system/user/model/count.ts
Normal file
15
app/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;
|
||||
}
|
||||
161
app/api/system/user/model/index.ts
Normal file
161
app/api/system/user/model/index.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type { Role } from '../../role/model';
|
||||
import type { Menu } from '../../menu/model';
|
||||
import type { Company } from '@/api/system/company/model';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface User {
|
||||
// 账号类型
|
||||
type?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
password2?: string;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
openId?: string;
|
||||
officeOpenid?: string;
|
||||
sessionKey?: 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;
|
||||
roleId?: number;
|
||||
roleName?: string;
|
||||
// 权限列表
|
||||
authorities?: Menu[];
|
||||
payTime?: string;
|
||||
deliveryTime?: string;
|
||||
receiptTime?: string;
|
||||
merchantId?: number;
|
||||
// 可管理的商户
|
||||
merchants?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 租户名称
|
||||
tenantName?: string;
|
||||
logo?: string;
|
||||
companyId?: number;
|
||||
companyInfo?: Company;
|
||||
planId?: number;
|
||||
code?: string;
|
||||
smsCode?: string;
|
||||
//
|
||||
remember?: boolean;
|
||||
balance?: number;
|
||||
points?: number;
|
||||
payMoney?: number;
|
||||
setting?: string;
|
||||
realName?: string;
|
||||
companyName?: string;
|
||||
merchantName?: string;
|
||||
merchantAvatar?: string;
|
||||
gradeName?: string;
|
||||
idCard?: string;
|
||||
comments?: string;
|
||||
recommend?: number;
|
||||
system?: any;
|
||||
// 头像地址
|
||||
avatarUrl?: string;
|
||||
// 1男,2女
|
||||
gender?: string;
|
||||
// 国家
|
||||
country?: string;
|
||||
// 邮箱是否验证, 0否, 1是
|
||||
emailVerified?: number;
|
||||
// 注册时间
|
||||
addTime?: number;
|
||||
//
|
||||
idcard?: string;
|
||||
//
|
||||
truename?: string;
|
||||
// 是否管理员:1是;2否
|
||||
isAdmin?: boolean;
|
||||
// 客户端ID
|
||||
clientId?: string;
|
||||
// 注册来源客户端 (APP、H5、小程序等)
|
||||
platform?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
isSuperAdmin?: boolean;
|
||||
deleted?: number;
|
||||
// 克隆的模板ID
|
||||
templateId?: number;
|
||||
// 是否安装
|
||||
installed?: boolean;
|
||||
label?: string;
|
||||
value?: number;
|
||||
// 关注数量
|
||||
followers?: number;
|
||||
// 推荐人ID
|
||||
dealerId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
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;
|
||||
isAdmin?: number;
|
||||
isSuperAdmin?: boolean;
|
||||
showProfile?: boolean;
|
||||
isStaff?: boolean;
|
||||
templateId?: number;
|
||||
}
|
||||
106
app/api/system/userOauth/index.ts
Normal file
106
app/api/system/userOauth/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {UserOauth, UserOauthParam} from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询第三方用户信息表
|
||||
*/
|
||||
export async function pageUserOauth(params: UserOauthParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserOauth>>>(
|
||||
SERVER_API_URL + '/system/user-oauth/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询第三方用户信息表列表
|
||||
*/
|
||||
export async function listUserOauth(params?: UserOauthParam) {
|
||||
const res = await request.get<ApiResult<UserOauth[]>>(
|
||||
SERVER_API_URL + '/system/user-oauth',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加第三方用户信息表
|
||||
*/
|
||||
export async function addUserOauth(data: UserOauth) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-oauth',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改第三方用户信息表
|
||||
*/
|
||||
export async function updateUserOauth(data: UserOauth) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-oauth',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除第三方用户信息表
|
||||
*/
|
||||
export async function removeUserOauth(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-oauth/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除第三方用户信息表
|
||||
*/
|
||||
export async function removeBatchUserOauth(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-oauth/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询第三方用户信息表
|
||||
*/
|
||||
export async function getUserOauth(id: number) {
|
||||
const res = await request.get<ApiResult<UserOauth>>(
|
||||
SERVER_API_URL + '/system/user-oauth/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
app/api/system/userOauth/model/index.ts
Normal file
39
app/api/system/userOauth/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 第三方用户信息表
|
||||
*/
|
||||
export interface UserOauth {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 第三方登陆类型(MP-WEIXIN)
|
||||
oauthType?: string;
|
||||
// 第三方用户唯一标识 (uid openid)
|
||||
oauthId?: string;
|
||||
// 微信unionID
|
||||
unionid?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方用户信息表搜索条件
|
||||
*/
|
||||
export interface UserOauthParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
48
app/api/system/userRole/index.ts
Normal file
48
app/api/system/userRole/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { UserRole, UserRoleParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询用户列表
|
||||
*/
|
||||
export async function listUserRole(params?: UserRoleParam) {
|
||||
const res = await request.get<ApiResult<UserRole[]>>(
|
||||
SERVER_API_URL + '/system/user-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 updateUserRole(data: UserRole) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-role',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户角色
|
||||
*/
|
||||
export async function addUserRole(data: UserRole) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-role',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
app/api/system/userRole/model/index.ts
Normal file
30
app/api/system/userRole/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户
|
||||
*/
|
||||
export interface UserRole {
|
||||
id?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 角色ID
|
||||
roleId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 角色名称
|
||||
roleName?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户搜索条件
|
||||
*/
|
||||
export interface UserRoleParam extends PageParam {
|
||||
keywords?: any;
|
||||
roleId?: number;
|
||||
userId?: number;
|
||||
userIds?: any;
|
||||
}
|
||||
106
app/api/system/userVerify/index.ts
Normal file
106
app/api/system/userVerify/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserVerify, UserVerifyParam } from './model';
|
||||
import {SERVER_API_URL} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询实名认证
|
||||
*/
|
||||
export async function pageUserVerify(params: UserVerifyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserVerify>>>(
|
||||
SERVER_API_URL + '/system/user-verify/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询实名认证列表
|
||||
*/
|
||||
export async function listUserVerify(params?: UserVerifyParam) {
|
||||
const res = await request.get<ApiResult<UserVerify[]>>(
|
||||
SERVER_API_URL + '/system/user-verify',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加实名认证
|
||||
*/
|
||||
export async function addUserVerify(data: UserVerify) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-verify',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改实名认证
|
||||
*/
|
||||
export async function updateUserVerify(data: UserVerify) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-verify',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除实名认证
|
||||
*/
|
||||
export async function removeUserVerify(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-verify/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除实名认证
|
||||
*/
|
||||
export async function removeBatchUserVerify(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/user-verify/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询实名认证
|
||||
*/
|
||||
export async function getUserVerify(id: number) {
|
||||
const res = await request.get<ApiResult<UserVerify>>(
|
||||
SERVER_API_URL + '/system/user-verify/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
54
app/api/system/userVerify/model/index.ts
Normal file
54
app/api/system/userVerify/model/index.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 实名认证
|
||||
*/
|
||||
export interface UserVerify {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 类型, 0个人, 1企业
|
||||
type?: number;
|
||||
// 主体名称
|
||||
name?: string;
|
||||
// 营业执照号码
|
||||
zzCode?: string;
|
||||
// 营业执照
|
||||
zzImg?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 证件号码
|
||||
idCard?: string;
|
||||
// 出生日期
|
||||
birthday?: string;
|
||||
// 正面
|
||||
sfz1?: string;
|
||||
// 反面
|
||||
sfz2?: string;
|
||||
// 机构名称
|
||||
organizationName?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0待审核, 1审核通过, 2/30驳回
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实名认证搜索条件
|
||||
*/
|
||||
export interface UserVerifyParam extends PageParam {
|
||||
id?: number;
|
||||
type?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
119
app/api/system/version/index.ts
Normal file
119
app/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
app/api/system/version/model/index.ts
Normal file
26
app/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;
|
||||
}
|
||||
162
app/api/system/website/field/index.ts
Normal file
162
app/api/system/website/field/index.ts
Normal file
@@ -0,0 +1,162 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
Config,
|
||||
WebsiteField,
|
||||
WebsiteFieldParam
|
||||
} from '@/api/system/website/field/model';
|
||||
import {SERVER_API_URL, TEMPLATE_ID} from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目参数
|
||||
*/
|
||||
export async function pageWebsiteField(params: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<WebsiteField>>>(
|
||||
SERVER_API_URL + '/system/website-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目参数列表
|
||||
*/
|
||||
export async function listWebsiteField(params?: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<WebsiteField[]>>(
|
||||
SERVER_API_URL + '/system/website-field',
|
||||
{
|
||||
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 getWebsiteField(id: number) {
|
||||
const res = await request.get<ApiResult<WebsiteField>>(
|
||||
SERVER_API_URL + '/system/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目参数
|
||||
*/
|
||||
export async function addWebsiteField(data: WebsiteField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目参数
|
||||
*/
|
||||
export async function updateWebsiteField(data: WebsiteField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目参数
|
||||
*/
|
||||
export async function removeWebsiteField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目参数
|
||||
*/
|
||||
export async function removeBatchWebsiteField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website-field/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/website-field/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 configWebsiteField(params?: WebsiteFieldParam) {
|
||||
const res = await request.get<ApiResult<Config>>(
|
||||
'https://cms-api.websoft.top/api/cms/cms-website-field/config',
|
||||
{
|
||||
params,
|
||||
headers: {
|
||||
TenantId: TEMPLATE_ID
|
||||
}
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复项目参数
|
||||
*/
|
||||
export async function undeleteWebsiteField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/website-field/undelete/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
63
app/api/system/website/field/model/index.ts
Normal file
63
app/api/system/website/field/model/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 网站参数
|
||||
*/
|
||||
export interface WebsiteField {
|
||||
id?: number;
|
||||
name?: string;
|
||||
value?: string;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
defaultValue?: string;
|
||||
modifyRange?: string;
|
||||
type?: number;
|
||||
status?: any;
|
||||
sortNumber?: any;
|
||||
createTime?: string;
|
||||
deleted?: number;
|
||||
}
|
||||
|
||||
// 约定的网站参数名称
|
||||
export interface WebsiteParam {
|
||||
// 网站名称
|
||||
site_logo?: string;
|
||||
// 登录页面标题
|
||||
login_name?: string;
|
||||
// 登录页面的背景图片
|
||||
login_bg_img?: string;
|
||||
}
|
||||
|
||||
// 约定的小程序参数名称
|
||||
export interface MpWeixinParam {
|
||||
// 小程序LOGO
|
||||
site_logo?: string;
|
||||
// 我的页面顶部背景图片
|
||||
mp_user_top?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站参数搜索条件
|
||||
*/
|
||||
export interface WebsiteFieldParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
name?: string;
|
||||
websiteId?: number;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
siteName?: string;
|
||||
siteLogo?: string;
|
||||
domain?: string;
|
||||
icpNo?: string;
|
||||
copyright?: string;
|
||||
loginBgImg?: string;
|
||||
address?: string;
|
||||
tel?: string;
|
||||
kefu2?: string;
|
||||
kefu1?: string;
|
||||
email?: string;
|
||||
loginTitle?: string;
|
||||
sysLogo?: string;
|
||||
}
|
||||
169
app/api/system/website/index.ts
Normal file
169
app/api/system/website/index.ts
Normal file
@@ -0,0 +1,169 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Website, WebsiteParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 获取网站信息
|
||||
*/
|
||||
export async function getSiteInfo() {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
SERVER_API_URL + '/system/website/getSiteInfo'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除缓存
|
||||
*/
|
||||
export async function removeSiteInfoCache(key?: string) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website/clearSiteInfo/' + key
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询网站
|
||||
*/
|
||||
export async function pageWebsite(params: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Website>>>(
|
||||
SERVER_API_URL + '/system/website/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询网站列表
|
||||
*/
|
||||
export async function listWebsite(params?: WebsiteParam) {
|
||||
const res = await request.get<ApiResult<Website[]>>(
|
||||
SERVER_API_URL + '/system/website',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加网站
|
||||
*/
|
||||
export async function addWebsite(data: Website) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改网站
|
||||
*/
|
||||
export async function updateWebsite(data: Website) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除网站
|
||||
*/
|
||||
export async function removeWebsite(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除网站
|
||||
*/
|
||||
export async function removeBatchWebsite(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*/
|
||||
export async function updateWebsiteStatus(websiteId?: number, status?: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/website/status',
|
||||
{
|
||||
websiteId,
|
||||
status
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询网站
|
||||
*/
|
||||
export async function getWebsite(id: number) {
|
||||
const res = await request.get<ApiResult<Website>>(
|
||||
SERVER_API_URL + '/system/website/' + 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/website/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
97
app/api/system/website/model/index.ts
Normal file
97
app/api/system/website/model/index.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 网站信息记录表
|
||||
*/
|
||||
export interface Website {
|
||||
// 站点ID
|
||||
websiteId?: number;
|
||||
// 网站名称
|
||||
websiteName?: string;
|
||||
// 网站标识
|
||||
websiteCode?: string;
|
||||
// 网站LOGO
|
||||
websiteIcon?: string;
|
||||
// 网站LOGO
|
||||
websiteLogo?: string;
|
||||
// 网站LOGO(深色模式)
|
||||
websiteDarkLogo?: string;
|
||||
// 网站类型
|
||||
websiteType?: string;
|
||||
// 网站关键词
|
||||
keywords?: string;
|
||||
// 域名前缀
|
||||
prefix?: string;
|
||||
// 绑定域名
|
||||
domain?: string;
|
||||
// 全局样式
|
||||
style?: string;
|
||||
// 后台管理地址
|
||||
adminUrl?: string;
|
||||
// 应用版本 10免费版 20专业版 30永久授权
|
||||
version?: number;
|
||||
// 服务到期时间
|
||||
expirationTime?: string;
|
||||
// 模版ID
|
||||
templateId?: number;
|
||||
// 行业类型(父级)
|
||||
industryParent?: string;
|
||||
// 行业类型(子级)
|
||||
industryChild?: string;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 联系电话
|
||||
phone?: string;
|
||||
// 电子邮箱
|
||||
email?: string;
|
||||
// ICP备案号
|
||||
icpNo?: string;
|
||||
// 公安备案
|
||||
policeNo?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停
|
||||
status?: number;
|
||||
// 维护说明
|
||||
statusText?: string;
|
||||
// 关闭说明
|
||||
statusClose?: string;
|
||||
// 全局样式
|
||||
styles?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站信息记录表搜索条件
|
||||
*/
|
||||
export interface WebsiteParam extends PageParam {
|
||||
websiteId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
146
app/api/system/white-domain/index.ts
Normal file
146
app/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
app/api/system/white-domain/model/index.ts
Normal file
27
app/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