Просмотр исходного кода

fix: 修复 ServiceConsultation 组件中的 TypeScript 类型错误

nahida 1 месяц назад
Родитель
Сommit
c2609eb072
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/components/support/ServiceConsultation.tsx

+ 2 - 2
src/components/support/ServiceConsultation.tsx

@@ -20,8 +20,8 @@ export default function ServiceConsultation() {
         const res = await clientGet<BasicInfo[]>("/webSite/getBasicInfo");
         const res = await clientGet<BasicInfo[]>("/webSite/getBasicInfo");
         if (res.code === 200 && res.data?.[0]) {
         if (res.code === 200 && res.data?.[0]) {
           setBasicInfo({
           setBasicInfo({
-            consultationHotline: res.data[0].consultationHotline,
-            telephone: res.data[0].telephone
+            consultationHotline: res.data[0].consultationHotline || "",
+            telephone: res.data[0].telephone || ""
           });
           });
         }
         }
       } catch (error) {
       } catch (error) {