fix:小程序跳转带参

This commit is contained in:
atshike
2025-01-17 17:57:43 +08:00
parent 4e3aa35e5a
commit b07082f08c
2 changed files with 9 additions and 1 deletions
@@ -90,11 +90,14 @@ class JumpController extends Controller
return $this->failed('当前小程序已无可用二维码!');
}
}
$path_str = data_get($link, 'config.url') ?: $mp->url;
$path_arr = explode('?',$path_str);
$cache['params'] = [
'appid' => $mp->app_id,
'secret' => $mp->secret,
'qr' => $qr ?? null,
'path' => data_get($link, 'config.url') ?: $mp->url,
'path' => $path_arr[0],
'path_query' => $path_arr[1] ?? null,
];
} elseif ($link->type === LinkType::KING_DOC) {
$cache['params']['sid'] = str_replace('https://kdocs.cn/l/', '', data_get($link, 'config.url')); // del
@@ -192,6 +195,9 @@ class JumpController extends Controller
}
$cache['target'] = data_get($res, 'openlink');
if (! empty($cache['params']['path_query'])) {
$cache['target'] = $cache['target'].'&'.$cache['params']['path_query'];
}
}
if (isset($cache['target']) && $cache['target']) {
@@ -152,6 +152,8 @@ class LinkController extends FormController
if ($iptType && in_array($iptType, [LinkType::MINI_PROGRAM->value, LinkType::LANDING_MINI->value])) {
$res['config.min_id'] = 'required';
$res['config.domain_id'] = '';
$res['config.url'] = '';
}
if ($iptType === LinkType::CLI_QR->value) {