Browse Source

fix:AI测量性别也可以修改

super-yimizi 2 weeks ago
parent
commit
4aca963ae7

+ 9 - 9
application/api/controller/AiMeasurement.php

@@ -427,7 +427,7 @@ class AiMeasurement extends Api
             } elseif ($httpCode !== 200) {
                 throw new \Exception('第三方AI服务返回异常状态: HTTP ' . $httpCode);
             }
-            
+            \think\Log::info('Third party AI service response: ' .$response);
             // 检查响应内容
             if (empty($response)) {
                 throw new \Exception('第三方AI服务返回空响应');
@@ -439,14 +439,14 @@ class AiMeasurement extends Api
             }
             
             // 记录API响应信息
-            $responseLog = [
-                'http_code' => $httpCode,
-                'response_size' => strlen($response) . ' bytes',
-                'has_body_size' => isset($result['body_size']),
-                'body_size_fields' => isset($result['body_size']) ? array_keys($result['body_size']) : [],
-                'response_preview' => substr($response, 0, 200) . '...'
-            ];
-            \think\Log::info('Third party AI service response: ' . json_encode($responseLog));
+            // $responseLog = [
+            //     'http_code' => $httpCode,
+            //     'response_size' => strlen($response) . ' bytes',
+            //     'has_body_size' => isset($result['body_size']),
+            //     'body_size_fields' => isset($result['body_size']) ? array_keys($result['body_size']) : [],
+            //     'response_preview' => substr($response, 0, 200) . '...'
+            // ];
+          
             
             // 处理返回的测量数据
             // echo "<pre>";

+ 1 - 1
application/api/controller/BodyProfile.php

@@ -87,7 +87,7 @@ class BodyProfile extends Api
         }
 
         // 过滤允许更新的字段
-        $allowedFields = ['profile_name', 'relation', 'age', 'height', 'weight', 'profile_photo', 'body_photos'];
+        $allowedFields = ['profile_name','gender','relation', 'age', 'height', 'weight', 'profile_photo', 'body_photos'];
         $updateData = [];
         
         foreach ($allowedFields as $field) {