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

fix(wechat): 使用正式版二维码并恢复页面参数

parent 49d33e7b
...@@ -175,11 +175,11 @@ class Wechat extends Common ...@@ -175,11 +175,11 @@ class Wechat extends Common
list($page, $scene) = array_pad(explode('?', $path, 2), 2, ''); list($page, $scene) = array_pad(explode('?', $path, 2), 2, '');
// 根据域名或配置动态选择环境版本 develop/release/trial // 根据域名或配置动态选择环境版本 develop/release/trial
$envVersion = 'trial'; $envVersion = 'release';
// 缓存键:使用 scene 参数作为唯一标识,支持缓存不同场景的二维码 // 缓存键:使用 scene 参数作为唯一标识,支持缓存不同场景的二维码
$cacheKey = 'wxacode_' . md5($scene . '_' . $envVersion); $cacheKey = 'wxacode_' . md5($scene . '_' . $envVersion);
$cacheTtl = 7 * 24 * 60 * 60; // 7 $cacheTtl = 365 * 24 * 60 * 60; // 365
// 尝试从缓存获取 // 尝试从缓存获取
$cachedImage = cache($cacheKey); $cachedImage = cache($cacheKey);
...@@ -197,8 +197,8 @@ class Wechat extends Common ...@@ -197,8 +197,8 @@ class Wechat extends Common
]; ];
custom_log(json_encode($inputParams, JSON_UNESCAPED_UNICODE), 'wechat'); custom_log(json_encode($inputParams, JSON_UNESCAPED_UNICODE), 'wechat');
// 去掉 page 参数,使用小程序默认页
$content = $mp->app_code->getUnlimit($scene, [ $content = $mp->app_code->getUnlimit($scene, [
'page' => $page,
'is_hyaline' => true, 'is_hyaline' => true,
'env_version' => $envVersion 'env_version' => $envVersion
]); ]);
......
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