字典工具封装增加trim方法容错

This commit is contained in:
linxd
2025-07-24 09:41:32 +08:00
parent 77a4bd56ae
commit baf3c25fa1
3 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ const SupplierAnnualResult: React.FC = () => {
}
};
useEffect(() => {
getDictList('project_status ').then((res) => {
getDictList('project_status').then((res) => {
if (res.success) {
setStatusOptions(res.data);
}

View File

@ -114,7 +114,7 @@ const SupplierAnnualReview: React.FC = () => {
// 首次加载获取数据
useEffect(() => {
fetchReviewList(pagination.current, pagination.pageSize, {});
getDictList('project_status ').then((res) => {
getDictList('project_status').then((res) => {
if (res.success) {
setReviewStatus(res.data);
}

View File

@ -42,7 +42,7 @@ export async function getDictList(code: string): Promise<DictResponse> {
const data: string | null = sessionStorage.getItem('dict');
if (data) {
const dictData = JSON.parse(data);
const codeType = `${code}=supplier_manage_type`;
const codeType = `${code.trim()}=supplier_manage_type`;
return Promise.resolve({
code: 200,
data: dictData[codeType],