修复重大故障: JwtAuthenticationFilter文件,远程读取用户接口导致的服务器请求数量跑满

This commit is contained in:
2025-02-22 00:00:33 +08:00
parent d61e683d41
commit def17d1de9
51 changed files with 1748 additions and 1436 deletions

View File

@@ -1,22 +1,22 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopMerchantApply, ShopMerchantApplyParam } from './model';
import { MODULES_API_URL } from '@/config';
import {COMMON_API_URL} from "~/config";
/**
* 分页查询商户入驻申请
*/
export async function pageShopMerchantApply(params: ShopMerchantApplyParam) {
const res = await request.get<ApiResult<PageResult<ShopMerchantApply>>>(
MODULES_API_URL + '/shop/shop-merchant-apply/page',
'/shop/shop-merchant-apply/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
if (res.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.message));
}
/**
@@ -24,15 +24,15 @@ export async function pageShopMerchantApply(params: ShopMerchantApplyParam) {
*/
export async function listShopMerchantApply(params?: ShopMerchantApplyParam) {
const res = await request.get<ApiResult<ShopMerchantApply[]>>(
MODULES_API_URL + '/shop/shop-merchant-apply',
'/shop/shop-merchant-apply',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.message));
}
/**
@@ -40,13 +40,13 @@ export async function listShopMerchantApply(params?: ShopMerchantApplyParam) {
*/
export async function addShopMerchantApply(data: ShopMerchantApply) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply',
COMMON_API_URL + '/shop/shop-merchant-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.message));
}
/**
@@ -54,42 +54,42 @@ export async function addShopMerchantApply(data: ShopMerchantApply) {
*/
export async function updateShopMerchantApply(data: ShopMerchantApply) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply',
COMMON_API_URL + '/shop/shop-merchant-apply',
data
);
if (res.data.code === 0) {
return res.data.message;
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.message));
}
/**
* 删除商户入驻申请
*/
export async function removeShopMerchantApply(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply/' + id
const res = await request.del<ApiResult<unknown>>(
'/shop/shop-merchant-apply/' + id
);
if (res.data.code === 0) {
return res.data.message;
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.message));
}
/**
* 批量删除商户入驻申请
*/
export async function removeBatchShopMerchantApply(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-merchant-apply/batch',
const res = await request.del<ApiResult<unknown>>(
'/shop/shop-merchant-apply/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
if (res.code === 0) {
return res.message;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.message));
}
/**
@@ -97,10 +97,36 @@ export async function removeBatchShopMerchantApply(data: (number | undefined)[])
*/
export async function getShopMerchantApply(id: number) {
const res = await request.get<ApiResult<ShopMerchantApply>>(
MODULES_API_URL + '/shop/shop-merchant-apply/' + id
'/shop/shop-merchant-apply/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.message));
}
/**
* 根据userId查询商户
*/
export async function getShopMerchantApplyByUserId() {
const res = await request.get<ApiResult<ShopMerchantApply>>(
COMMON_API_URL + '/shop/shop-merchant-apply/getByUserId'
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}
/**
* 根据phone查询商户入驻申请
*/
export async function getShopMerchantApplyByPhone() {
const res = await request.get<ApiResult<ShopMerchantApply>>(
COMMON_API_URL + '/shop/shop-merchant-apply/getByPhone'
);
if (res.code === 0 && res.data) {
return res.data;
}
return Promise.reject(new Error(res.message));
}