字典工具封装增加trim方法容错
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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],
|
||||
|
Reference in New Issue
Block a user