整理系统菜单及权限

This commit is contained in:
gxwebsoft
2024-05-01 16:50:27 +08:00
parent ae068890b2
commit 0bf561f544
60 changed files with 4288 additions and 2007 deletions
+24 -8
View File
@@ -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;
}