Merge remote-tracking branch 'origin/master'

This commit is contained in:
knowpia
2022-09-19 14:03:57 +08:00
2 changed files with 8 additions and 3 deletions

View File

@@ -101,6 +101,10 @@ class Wechat
{
$clientToken = Request::get('token');
$orderId = Request::get('order_id');
$callback = Request::get('callback');
$sep = str_contains($callback, '?') ? '&' : '?';
$callback = $callback.$sep.'refresh=true';
if ($clientToken) {
$tk = json_decode(authcode($clientToken), true);
$userId = $tk['userid'];
@@ -150,7 +154,7 @@ class Wechat
}
$prepayId = $unify['prepay_id'];
$jssdk = $payment->jssdk->bridgeConfig($prepayId, false);
return View::fetch('', ['jssdk' => $jssdk]);
return View::fetch('', ['jssdk' => $jssdk, 'callback' => $callback]);
}
/**

View File

@@ -49,7 +49,8 @@
, btn: ['3秒后自动返回']
, time: 3
, end: function () {
window.history.back()
window.local.href = '{$callback}';
// window.history.back()
}
});
}, 1000);
@@ -60,7 +61,7 @@
, btn: ['3秒后自动返回']
, time: 3
, end: function () {
window.history.back()
window.local.href = '{$callback}';
}
});
}