Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
fbf60e54
Commit
fbf60e54
authored
May 19, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D试戴 调试8
parent
509a5110
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
42 deletions
+2
-42
Ai.php
addons/shopro/service/user/Ai.php
+2
-42
No files found.
addons/shopro/service/user/Ai.php
View file @
fbf60e54
...
@@ -196,44 +196,8 @@ class Ai
...
@@ -196,44 +196,8 @@ 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
(
HttpResponseException
$e
)
{
$response
=
$e
->
getResponse
();
$body
=
(
string
)
$response
->
getData
();
// 解析 JSON 获取详细错误
try
{
$errorData
=
json_decode
(
$body
,
true
);
$fullMessage
=
''
;
if
(
!
empty
(
$errorData
[
'error'
]))
{
$error
=
$errorData
[
'error'
];
$fullMessage
=
$error
[
'message'
]
??
''
;
// 如果有详细错误信息
if
(
!
empty
(
$error
[
'details'
]))
{
$fullMessage
.=
"
\n
Details: "
.
json_encode
(
$error
[
'details'
],
JSON_UNESCAPED_UNICODE
);
}
}
// 如果解析失败,使用原始响应
if
(
empty
(
$fullMessage
))
{
$fullMessage
=
$body
;
}
// 记录完整错误
format_log_error_custom_name
(
$e
,
'[AI生成图片接口异常]'
,
$body
,
'gen_ai'
);
}
catch
(
\Exception
$jsonE
)
{
// 非JSON响应
format_log_error_custom_name
(
$e
,
'[AI生成图片接口异常]'
,
$jsonE
->
getMessage
(),
'gen_ai'
);
}
// $message = $data ? ($data['msg'] ?? '') : $e->getMessage();
// format_log_error_custom_name($e, '[AI生成图片接口异常]'.' user_id:'. $userId , $message , 'gen_ai');
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$response
=
$e
->
getResponse
();
format_log_error_custom_name
(
$e
,
'[AI生成图片接口异常]'
,
'用户ID:'
.
$userId
.
' response_format'
.
$response_format
,
'gen_ai'
);
$body
=
(
string
)
$response
->
getData
();
format_log_error_custom_name
(
$e
,
'[AI生成图片接口异常]'
,
'用户ID:'
.
$userId
.
' response_format'
.
$response_format
.
' 全错误信息:'
.
$body
,
'gen_ai'
);
return
[
return
[
'code'
=>
0
,
'code'
=>
0
,
'msg'
=>
'图片生成失败'
'msg'
=>
'图片生成失败'
...
@@ -313,12 +277,8 @@ class Ai
...
@@ -313,12 +277,8 @@ class Ai
'data'
=>
$result
[
'id'
]
??
''
'data'
=>
$result
[
'id'
]
??
''
];
];
}
catch
(
HttpResponseException
$e
)
{
$data
=
$e
->
getResponse
()
->
getData
();
$message
=
$data
?
(
$data
[
'msg'
]
??
''
)
:
$e
->
getMessage
();
format_log_error_custom_name
(
$e
,
'[AI生成视频接口异常]'
,
'用户ID:'
.
$userId
,
$message
,
'gen_ai'
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
format_log_error_custom_name
(
$e
,
'[AI生成视频接口异常]
'
,
'用户ID:'
.
$userId
,
''
,
'gen_ai'
);
format_log_error_custom_name
(
$e
,
'[AI生成视频接口异常]
用户ID:'
.
$userId
,
''
,
'gen_ai'
);
return
[
return
[
'code'
=>
0
,
'code'
=>
0
,
'msg'
=>
'视频生成失败'
'msg'
=>
'视频生成失败'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment