整理系统菜单及权限
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Merchant, MerchantParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户
|
||||
*/
|
||||
export async function pageMerchant(params: MerchantParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Merchant>>>(
|
||||
MODULES_API_URL + '/shop/merchant/page',
|
||||
SERVER_API_URL + '/system/merchant/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export async function pageMerchant(params: MerchantParam) {
|
||||
*/
|
||||
export async function listMerchant(params?: MerchantParam) {
|
||||
const res = await request.get<ApiResult<Merchant[]>>(
|
||||
MODULES_API_URL + '/shop/merchant',
|
||||
SERVER_API_URL + '/system/merchant',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export async function listMerchant(params?: MerchantParam) {
|
||||
*/
|
||||
export async function addMerchant(data: Merchant) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant',
|
||||
SERVER_API_URL + '/system/merchant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +54,7 @@ export async function addMerchant(data: Merchant) {
|
||||
*/
|
||||
export async function updateMerchant(data: Merchant) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant',
|
||||
SERVER_API_URL + '/system/merchant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +68,7 @@ export async function updateMerchant(data: Merchant) {
|
||||
*/
|
||||
export async function removeMerchant(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant/' + id
|
||||
SERVER_API_URL + '/system/merchant/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +81,7 @@ export async function removeMerchant(id?: number) {
|
||||
*/
|
||||
export async function removeBatchMerchant(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant/batch',
|
||||
SERVER_API_URL + '/system/merchant/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export async function removeBatchMerchant(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function getMerchant(id: number) {
|
||||
const res = await request.get<ApiResult<Merchant>>(
|
||||
MODULES_API_URL + '/shop/merchant/' + id
|
||||
SERVER_API_URL + '/system/merchant/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
@@ -55,10 +55,6 @@ export interface Merchant {
|
||||
// 默认商户管理角色ID
|
||||
roleId?: number;
|
||||
roleName?: string;
|
||||
key?: number;
|
||||
value?: number;
|
||||
title?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantAccount, MerchantAccountParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户账号
|
||||
*/
|
||||
export async function pageMerchantAccount(params: MerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantAccount>>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/page',
|
||||
SERVER_API_URL + '/system/merchant-account/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export async function pageMerchantAccount(params: MerchantAccountParam) {
|
||||
*/
|
||||
export async function listMerchantAccount(params?: MerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<MerchantAccount[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-account',
|
||||
SERVER_API_URL + '/system/merchant-account',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export async function listMerchantAccount(params?: MerchantAccountParam) {
|
||||
*/
|
||||
export async function addMerchantAccount(data: MerchantAccount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account',
|
||||
SERVER_API_URL + '/system/merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +54,7 @@ export async function addMerchantAccount(data: MerchantAccount) {
|
||||
*/
|
||||
export async function updateMerchantAccount(data: MerchantAccount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account',
|
||||
SERVER_API_URL + '/system/merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +68,7 @@ export async function updateMerchantAccount(data: MerchantAccount) {
|
||||
*/
|
||||
export async function removeMerchantAccount(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/' + id
|
||||
SERVER_API_URL + '/system/merchant-account/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +81,7 @@ export async function removeMerchantAccount(id?: number) {
|
||||
*/
|
||||
export async function removeBatchMerchantAccount(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/batch',
|
||||
SERVER_API_URL + '/system/merchant-account/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,10 +97,26 @@ export async function removeBatchMerchantAccount(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function getMerchantAccount(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantAccount>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/' + id
|
||||
SERVER_API_URL + '/system/merchant-account/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getMerchantAccountByPhone(params?: MerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<MerchantAccount>>(
|
||||
SERVER_API_URL + '/system/merchant-account/getMerchantAccountByPhone',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 1) {
|
||||
return null;
|
||||
}
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ export interface MerchantAccount {
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
merchantName?: string;
|
||||
// 是否需要审核
|
||||
goodsReview?: boolean;
|
||||
roleId?: number;
|
||||
roleName?: string;
|
||||
// 用户ID
|
||||
@@ -35,5 +37,6 @@ export interface MerchantAccount {
|
||||
*/
|
||||
export interface MerchantAccountParam extends PageParam {
|
||||
id?: number;
|
||||
phone?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantApply, MerchantApplyParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户入驻申请
|
||||
*/
|
||||
export async function pageMerchantApply(params: MerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantApply>>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/page',
|
||||
SERVER_API_URL + '/system/merchant-apply/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export async function pageMerchantApply(params: MerchantApplyParam) {
|
||||
*/
|
||||
export async function listMerchantApply(params?: MerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<MerchantApply[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply',
|
||||
SERVER_API_URL + '/system/merchant-apply',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export async function listMerchantApply(params?: MerchantApplyParam) {
|
||||
*/
|
||||
export async function addMerchantApply(data: MerchantApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply',
|
||||
SERVER_API_URL + '/system/merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +54,7 @@ export async function addMerchantApply(data: MerchantApply) {
|
||||
*/
|
||||
export async function updateMerchantApply(data: MerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply',
|
||||
SERVER_API_URL + '/system/merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +68,7 @@ export async function updateMerchantApply(data: MerchantApply) {
|
||||
*/
|
||||
export async function removeMerchantApply(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/' + id
|
||||
SERVER_API_URL + '/system/merchant-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +81,7 @@ export async function removeMerchantApply(id?: number) {
|
||||
*/
|
||||
export async function removeBatchMerchantApply(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/batch',
|
||||
SERVER_API_URL + '/system/merchant-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export async function removeBatchMerchantApply(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function getMerchantApply(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantApply>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/' + id
|
||||
SERVER_API_URL + '/system/merchant-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantType, MerchantTypeParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户类型
|
||||
*/
|
||||
export async function pageMerchantType(params: MerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantType>>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/page',
|
||||
SERVER_API_URL + '/system/merchant-type/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export async function pageMerchantType(params: MerchantTypeParam) {
|
||||
*/
|
||||
export async function listMerchantType(params?: MerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<MerchantType[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-type',
|
||||
SERVER_API_URL + '/system/merchant-type',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export async function listMerchantType(params?: MerchantTypeParam) {
|
||||
*/
|
||||
export async function addMerchantType(data: MerchantType) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type',
|
||||
SERVER_API_URL + '/system/merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +54,7 @@ export async function addMerchantType(data: MerchantType) {
|
||||
*/
|
||||
export async function updateMerchantType(data: MerchantType) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type',
|
||||
SERVER_API_URL + '/system/merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +68,7 @@ export async function updateMerchantType(data: MerchantType) {
|
||||
*/
|
||||
export async function removeMerchantType(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/' + id
|
||||
SERVER_API_URL + '/system/merchant-type/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +81,7 @@ export async function removeMerchantType(id?: number) {
|
||||
*/
|
||||
export async function removeBatchMerchantType(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/batch',
|
||||
SERVER_API_URL + '/system/merchant-type/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export async function removeBatchMerchantType(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function getMerchantType(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantType>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/' + id
|
||||
SERVER_API_URL + '/system/merchant-type/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
Reference in New Issue
Block a user