Browse Source

V2.6.2映射账号添加姓名

liuq 3 weeks ago
parent
commit
1bdd66ceb6

+ 5 - 0
backend/app/api/v1/endpoints/apps.py

@@ -911,6 +911,7 @@ def read_mappings(
             user_id=m.user_id,
             mapped_key=m.mapped_key,
             mapped_email=m.mapped_email,
+            user_name=m.user.name if m.user else None,
             user_mobile=m.user.mobile if m.user else "Deleted User",
             user_status=m.user.status if m.user else "DELETED",
             is_active=m.is_active
@@ -1029,6 +1030,7 @@ def create_mapping(
         user_id=mapping.user_id,
         mapped_key=mapping.mapped_key,
         mapped_email=mapping.mapped_email,
+        user_name=user.name,
         user_mobile=user.mobile,
         user_status=user.status,
         is_active=mapping.is_active,
@@ -1133,6 +1135,7 @@ def update_mapping(
         user_id=mapping.user_id,
         mapped_key=mapping.mapped_key,
         mapped_email=mapping.mapped_email,
+        user_name=mapping.user.name if mapping.user else None,
         user_mobile=mapping.user.mobile if mapping.user else "Deleted User",
         user_status=mapping.user.status if mapping.user else "DELETED",
         is_active=mapping.is_active
@@ -1596,6 +1599,7 @@ def sync_mapping(
             user_id=mapping.user_id,
             mapped_key=mapping.mapped_key,
             mapped_email=mapping.mapped_email,
+            user_name=user.name,
             user_mobile=user.mobile,
             user_status=user.status,
             is_active=False # 标记为非活跃/已删除
@@ -1763,6 +1767,7 @@ def sync_mapping(
         user_id=mapping.user_id,
         mapped_key=mapping.mapped_key,
         mapped_email=mapping.mapped_email,
+        user_name=user.name,
         user_mobile=user.mobile,
         user_status=user.status,
         is_active=mapping.is_active

+ 1 - 0
backend/app/schemas/mapping.py

@@ -71,6 +71,7 @@ class MappingResponse(BaseModel):
     user_id: int
     mapped_key: Optional[str] = None
     mapped_email: Optional[str] = None
+    user_name: Optional[str] = None
     user_mobile: str  # Convenient to have
     user_status: str  # Added: Unified Account Status
     is_active: bool = True

+ 1 - 0
frontend/src/api/apps.ts

@@ -46,6 +46,7 @@ export interface MappingResponse {
   user_id: number
   mapped_key: string
   mapped_email?: string
+  user_name?: string
   user_mobile: string
   user_status: string // Added
   is_active: boolean

+ 5 - 0
frontend/src/views/apps/MappingImport.vue

@@ -49,6 +49,11 @@
         </div>
 
         <el-table :data="mappings" v-loading="loading" stripe border style="width: 100%; margin-top: 15px;">
+          <el-table-column prop="user_name" label="统一认证姓名">
+            <template #default="scope">
+              {{ scope.row.user_name || '—' }}
+            </template>
+          </el-table-column>
           <el-table-column prop="user_mobile" label="用户手机号" />
           <el-table-column prop="user_status" label="统一认证账号状态" width="150">
             <template #default="scope">