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
a4c2d32a
Commit
a4c2d32a
authored
May 19, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D试戴订阅消息调试2
parent
a00169a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
helper.php
addons/shopro/helper/helper.php
+34
-0
AiVideoGen.php
addons/shopro/job/AiVideoGen.php
+6
-2
No files found.
addons/shopro/helper/helper.php
View file @
a4c2d32a
...
@@ -629,6 +629,40 @@ if (!function_exists('format_log_error')) {
...
@@ -629,6 +629,40 @@ if (!function_exists('format_log_error')) {
}
}
}
}
if
(
!
function_exists
(
'format_log_error_custom_name'
))
{
/**
* 格式化记录日志,自定义名称
*
* @param object $error 日志异常类
* @param string $name 日志业务场景描述
* @param string $message 日志内容
* @param string $log_name 文件名(不需要 .log)
* @param string $level 级别 info/error/debug
* @return void
*/
function
format_log_error_custom_name
(
$error
,
$name
=
'QUEUE'
,
$message
=
''
,
$log_name
=
'error_custom_name'
,
$level
=
'info'
)
{
$logInfo
=
[
"==========
$name
LOG INFO BEGIN =========="
,
'[ Message ] '
.
var_export
(
'['
.
$error
->
getCode
()
.
']'
.
$error
->
getMessage
()
.
' '
.
$message
,
true
),
'[ File ] '
.
var_export
(
$error
->
getFile
()
.
':'
.
$error
->
getLine
(),
true
),
'[ Trace ] '
.
var_export
(
$error
->
getTraceAsString
(),
true
),
"=============================================
$name
LOG INFO ENDED =========="
,
];
$logInfo
=
implode
(
PHP_EOL
,
$logInfo
)
.
PHP_EOL
;
\think\Log
::
init
([
'type'
=>
'File'
,
'path'
=>
RUNTIME_PATH
.
'log/'
.
date
(
'Ym'
)
.
'/'
,
'single'
=>
$name
.
'_'
.
date
(
'Ymd'
)
.
'_'
,
'max_files'
=>
0
,
]);
\think\Log
::
record
(
$logInfo
,
$level
);
}
}
if
(
!
function_exists
(
'set_token_in_header'
))
{
if
(
!
function_exists
(
'set_token_in_header'
))
{
/**
/**
* 设置token令牌到响应的header中
* 设置token令牌到响应的header中
...
...
addons/shopro/job/AiVideoGen.php
View file @
a4c2d32a
...
@@ -5,6 +5,7 @@ namespace addons\shopro\job;
...
@@ -5,6 +5,7 @@ namespace addons\shopro\job;
use
addons\shopro\library\activity\getter\Db
;
use
addons\shopro\library\activity\getter\Db
;
use
addons\shopro\library\HttpClient
as
Http
;
use
addons\shopro\library\HttpClient
as
Http
;
use
app\admin\model\shopro\AiTryon
as
AiTryOnModel
;
use
app\admin\model\shopro\AiTryon
as
AiTryOnModel
;
use
think\exception\HttpResponseException
;
use
think\Log
;
use
think\Log
;
use
think\queue\Job
;
use
think\queue\Job
;
use
app\admin\model\shopro\user\User
;
use
app\admin\model\shopro\user\User
;
...
@@ -303,9 +304,12 @@ class AiVideoGen extends BaseJob
...
@@ -303,9 +304,12 @@ class AiVideoGen extends BaseJob
$this
->
debug_log
(
'[AI视频]通知发送成功: user_id='
.
$user_id
.
' taskid='
.
$taskid
);
$this
->
debug_log
(
'[AI视频]通知发送成功: user_id='
.
$user_id
.
' taskid='
.
$taskid
);
return
true
;
return
true
;
}
catch
(
HttpResponseException
$e
)
{
$data
=
$e
->
getResponse
()
->
getData
();
$message
=
$data
?
(
$data
[
'msg'
]
??
''
)
:
$e
->
getMessage
();
format_log_error_custom_name
(
$e
,
'[AI视频]通知发送失败: user_id='
.
$user_id
.
' taskid='
.
$taskid
,
$message
,
'gen_ai_video'
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$this
->
debug_log
(
'[AI视频]通知发送失败: user_id='
.
$user_id
.
' taskid='
.
$taskid
.
' '
.
$e
->
getMessage
());
format_log_error_custom_name
(
$e
,
'[AI视频]通知发送失败: user_id='
.
$user_id
.
' taskid='
.
$taskid
,
'gen_ai_video'
);
return
false
;
}
}
}
}
...
...
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