浏览代码

250225-1代码。

baoyubo 4 月之前
父节点
当前提交
4a338524cb
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      routers/prod_api/system/area/__init__.py

+ 4 - 1
routers/prod_api/system/area/__init__.py

@@ -65,6 +65,9 @@ def read_all_areas(parent_id:int = 1,db: Session = Depends(get_db)):
         return query.first()
     try:
         area_info = id_get_area_info(parent_id)
+        parentLabel=''
+        if area_info:
+            parentLabel = area_info.area_name
         area_list = parent_id_get_area_info(parent_id)
         data = []
 
@@ -76,7 +79,7 @@ def read_all_areas(parent_id:int = 1,db: Session = Depends(get_db)):
                 'label': info.area_name,
                 'personSum': 0,
                 'isShowSelect': isShowSelect,
-                'parentLabel': area_info.area_name})
+                'parentLabel': parentLabel})
         return {
                 "code": 200,
                 "msg": "成功",