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
e8ae0a3b
Commit
e8ae0a3b
authored
May 21, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化分享海报接口 日志
parent
a74f823f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
Wechat.php
addons/shopro/controller/third/Wechat.php
+32
-1
No files found.
addons/shopro/controller/third/Wechat.php
View file @
e8ae0a3b
...
@@ -186,8 +186,22 @@ class Wechat extends Common
...
@@ -186,8 +186,22 @@ class Wechat extends Common
$page
=
'/'
.
$page
;
$page
=
'/'
.
$page
;
}
}
// 根据域名或配置动态选择环境版本
// 根据域名或配置动态选择环境版本
$envVersion
=
'develop'
;
$envVersion
=
'develop'
;
$inputParams
=
[
'platform'
=>
$this
->
platform
,
'payload'
=>
$this
->
payload
,
'path'
=>
$path
,
'page'
=>
$page
,
'scene'
=>
$scene
,
'env_version'
=>
$envVersion
,
'request_page'
=>
substr
(
$page
,
1
)
];
custom_log
(
json_encode
(
$inputParams
,
JSON_UNESCAPED_UNICODE
),
'wechat'
);
$content
=
$mp
->
app_code
->
getUnlimit
(
$scene
,
[
$content
=
$mp
->
app_code
->
getUnlimit
(
$scene
,
[
'page'
=>
substr
(
$page
,
1
),
// 微信接口要求不带开头的 /
'page'
=>
substr
(
$page
,
1
),
// 微信接口要求不带开头的 /
'is_hyaline'
=>
true
,
'is_hyaline'
=>
true
,
...
@@ -195,12 +209,29 @@ class Wechat extends Common
...
@@ -195,12 +209,29 @@ class Wechat extends Common
]);
]);
if
(
$content
instanceof
\EasyWeChat\Kernel\Http\StreamResponse
)
{
if
(
$content
instanceof
\EasyWeChat\Kernel\Http\StreamResponse
)
{
// 成功返回图片
$outputParams
=
[
'success'
=>
true
,
'type'
=>
'StreamResponse'
,
'content_length'
=>
strlen
(
$content
->
getBodyContents
()),
'content_type'
=>
'image/png'
];
custom_log
(
'[微信小程序码]获取成功 : pag'
.
json_encode
(
$outputParams
),
'wechat'
);
return
response
(
$content
->
getBody
(),
200
,
[
'Content-Length'
=>
strlen
(
$content
->
getBodyContents
())])
->
contentType
(
'image/png'
);
return
response
(
$content
->
getBody
(),
200
,
[
'Content-Length'
=>
strlen
(
$content
->
getBodyContents
())])
->
contentType
(
'image/png'
);
}
else
{
}
else
{
// 记录详细日志
// 记录详细日志
$errcode
=
$content
[
'errcode'
]
??
'-'
;
$errcode
=
$content
[
'errcode'
]
??
'-'
;
$errmsg
=
$content
[
'errmsg'
]
??
''
;
$errmsg
=
$content
[
'errmsg'
]
??
''
;
custom_log
(
'[微信小程序码]获取失败: page='
.
$page
.
', scene='
.
$scene
.
', env='
.
$envVersion
.
', errcode='
.
$errcode
.
', errmsg='
.
$errmsg
,
'wechat'
);
$outputParams
=
[
'success'
=>
false
,
'errcode'
=>
$errcode
,
'errmsg'
=>
$errmsg
,
'page'
=>
$page
,
'scene'
=>
$scene
,
'env_version'
=>
$envVersion
];
custom_log
(
'[微信小程序码] 获取失败:'
.
json_encode
(
$outputParams
),
'wechat'
);
$this
->
error
(
'获取小程序码失败: ['
.
$errcode
.
'] '
.
$errmsg
);
$this
->
error
(
'获取小程序码失败: ['
.
$errcode
.
'] '
.
$errmsg
);
}
}
...
...
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