恢复用户列表功能
This commit is contained in:
@@ -2,14 +2,14 @@ import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { Company, CompanyParam } from './model';
|
||||
import { PageResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询企业资料
|
||||
*/
|
||||
export async function getCompany(params?: CompanyParam) {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
MODULES_API_URL + '/oa/company/profile',
|
||||
SERVER_API_URL + '/system/company/profile',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -25,7 +25,7 @@ export async function getCompany(params?: CompanyParam) {
|
||||
*/
|
||||
export async function getCompanyAll(companyId: number) {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
MODULES_API_URL + '/oa/company/profileAll/' + companyId
|
||||
SERVER_API_URL + '/system/company/profileAll/' + companyId
|
||||
);
|
||||
if (res.data.code === 0 && res.data) {
|
||||
console.log(res.data);
|
||||
@@ -39,7 +39,7 @@ export async function getCompanyAll(companyId: number) {
|
||||
*/
|
||||
export async function pageCompany(params: CompanyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Company>>>(
|
||||
MODULES_API_URL + '/oa/company/page',
|
||||
SERVER_API_URL + '/system/company/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -53,7 +53,7 @@ export async function pageCompany(params: CompanyParam) {
|
||||
*/
|
||||
export async function pageCompanyAll(params: CompanyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Company>>>(
|
||||
MODULES_API_URL + '/oa/company/pageAll',
|
||||
SERVER_API_URL + '/system/company/pageAll',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -67,7 +67,7 @@ export async function pageCompanyAll(params: CompanyParam) {
|
||||
*/
|
||||
export async function addCompany(data: Company) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company',
|
||||
SERVER_API_URL + '/system/company',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -81,7 +81,7 @@ export async function addCompany(data: Company) {
|
||||
*/
|
||||
export async function updateCompany(data: Company) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company',
|
||||
SERVER_API_URL + '/system/company',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -95,7 +95,7 @@ export async function updateCompany(data: Company) {
|
||||
*/
|
||||
export async function removeCompany(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company/' + id
|
||||
SERVER_API_URL + '/system/company/removeAll/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -106,7 +106,7 @@ export async function removeCompany(id?: number) {
|
||||
// 销毁租户
|
||||
export async function destructionTenant(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company/destruction/' + id
|
||||
SERVER_API_URL + '/system/company/destruction/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -119,7 +119,7 @@ export async function destructionTenant(id?: number) {
|
||||
*/
|
||||
export async function removeBatchCompany(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company/batch',
|
||||
SERVER_API_URL + '/system/company/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -136,7 +136,7 @@ export async function checkExistence(
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/oa/company/existence',
|
||||
SERVER_API_URL + '/system/company/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
@@ -146,3 +146,29 @@ export async function checkExistence(
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复Company
|
||||
*/
|
||||
export async function undeleteCompany(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/undeleteAll/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 销毁Company
|
||||
*/
|
||||
export async function destructionCompany(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/destructionAll/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ export interface Company {
|
||||
planId?: number;
|
||||
sortNumber?: number;
|
||||
authoritative?: boolean;
|
||||
merchantId?: number;
|
||||
tenantId?: number;
|
||||
tenantName?: string;
|
||||
tenantCode?: string;
|
||||
@@ -56,6 +57,10 @@ export interface Company {
|
||||
socketUrl?: string;
|
||||
serverUrl?: string;
|
||||
modulesUrl?: string;
|
||||
mpWeixinCode?: string;
|
||||
h5Code?: string;
|
||||
androidUrl?: string;
|
||||
iosUrl?: string;
|
||||
avatar?: string;
|
||||
nickname?: string;
|
||||
code?: number;
|
||||
|
||||
Reference in New Issue
Block a user