From 47941ad9c0439cdffb4698caff31f2e66e8d4b2d Mon Sep 17 00:00:00 2001 From: luchang <835498386@qq.com> Date: Mon, 27 May 2024 09:38:33 +0800 Subject: [PATCH] feat: constant --- config/config.dev.ts | 11 +++++------ config/config.prod.ts | 2 +- src/components/Banner/index.tsx | 2 +- src/constant/index.ts | 15 +++++++++++++++ src/pages/UserList.tsx | 5 +++++ src/requestErrorConfig.ts | 1 + 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/config/config.dev.ts b/config/config.dev.ts index 83a5f0e..2db770e 100644 --- a/config/config.dev.ts +++ b/config/config.dev.ts @@ -1,10 +1,9 @@ -import { defineConfig } from "@umijs/max"; - +import { defineConfig } from '@umijs/max'; export default defineConfig({ define: { 'process.env': { - API_HOST_URL: 'http://localhost:3000' - } - } -}) + API_HOST_URL: 'http://localhost:4399', + }, + }, +}); diff --git a/config/config.prod.ts b/config/config.prod.ts index 9465d02..2db770e 100644 --- a/config/config.prod.ts +++ b/config/config.prod.ts @@ -3,7 +3,7 @@ import { defineConfig } from '@umijs/max'; export default defineConfig({ define: { 'process.env': { - API_HOST_URL: 'http://localhost:3000', + API_HOST_URL: 'http://localhost:4399', }, }, }); diff --git a/src/components/Banner/index.tsx b/src/components/Banner/index.tsx index e791c5d..91c27bb 100644 --- a/src/components/Banner/index.tsx +++ b/src/components/Banner/index.tsx @@ -89,7 +89,7 @@ const Banner: React.FC = ({ type, dataSource, onChange, onDelFile }) => { editable: (text, record, index) => { return index !== 0; }, + render: (_, record) => { + const bank = bankList.find((item) => item.id === record.type); + return <>{bank?.name}; + }, }, { title: '操作', diff --git a/src/requestErrorConfig.ts b/src/requestErrorConfig.ts index 4835eb8..4f88845 100644 --- a/src/requestErrorConfig.ts +++ b/src/requestErrorConfig.ts @@ -45,6 +45,7 @@ export const errorConfig: RequestConfig = { // 我们的 errorThrower 抛出的错误。 if (error.name === 'BizError') { const errorInfo: ResponseStructure | undefined = error.info; + if (errorInfo) { const { errorMessage, errorCode } = errorInfo; switch (errorInfo.showType) {