Commit d0180cd1 authored by 刘小敏's avatar 刘小敏

3D试戴优化4

parent af3b9b39
...@@ -7,6 +7,7 @@ use addons\shopro\notification\ai\AiVideoSuccess; ...@@ -7,6 +7,7 @@ use addons\shopro\notification\ai\AiVideoSuccess;
use app\admin\model\shopro\AiTryon as AiTryOnModel; use app\admin\model\shopro\AiTryon as AiTryOnModel;
use app\admin\model\shopro\user\User; use app\admin\model\shopro\user\User;
use think\Config; use think\Config;
use think\exception\HttpResponseException;
use think\Log; use think\Log;
...@@ -195,12 +196,12 @@ class Ai ...@@ -195,12 +196,12 @@ class Ai
'data' => $response_format == 'b64_json' ? $result['data'][0]['b64_json'] : $result['data'][0]['url'] 'data' => $response_format == 'b64_json' ? $result['data'][0]['b64_json'] : $result['data'][0]['url']
]; ];
} catch (\Exception $e) { } catch (HttpResponseException $e) {
$data = $e->getResponse()->getData(); $data = $e->getResponse()->getData();
$message = $data ? ($data['msg'] ?? '') : $e->getMessage(); $message = $data ? ($data['msg'] ?? '') : $e->getMessage();
format_log_error_custom_name($e, '[AI生成图片接口异常]','用户ID:'. $userId . ' response_format'. $response_format , $message , 'gen_ai'); format_log_error_custom_name($e, '[AI生成图片接口异常]'.' user_id:'. $userId , $message , 'gen_ai');
} catch (\Exception $e) {
format_log_error_custom_name($e, '[AI生成图片接口异常]','用户ID:'. $userId . ' response_format'. $response_format , 'gen_ai' );
return [ return [
'code' => 0 , 'code' => 0 ,
'msg' => '图片生成失败' 'msg' => '图片生成失败'
...@@ -280,14 +281,15 @@ class Ai ...@@ -280,14 +281,15 @@ class Ai
'data' => $result['id'] ?? '' 'data' => $result['id'] ?? ''
]; ];
} catch (\Exception $e) { } catch (HttpResponseException $e) {
$data = $e->getResponse()->getData(); $data = $e->getResponse()->getData();
$message = $data ? ($data['msg'] ?? '') : $e->getMessage(); $message = $data ? ($data['msg'] ?? '') : $e->getMessage();
format_log_error_custom_name($e, '[AI生成视频接口异常]','用户ID:'. $userId , $message , 'gen_ai'); format_log_error_custom_name($e, '[AI生成视频接口异常]','用户ID:'. $userId , $message , 'gen_ai');
} catch (\Exception $e) {
format_log_error_custom_name($e, '[AI生成视频接口异常]','用户ID:'. $userId , '' , 'gen_ai');
return [ return [
'code' => 0 , 'code' => 0 ,
'msg' => '图片生成失败' 'msg' => '视频生成失败'
]; ];
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment