查询字符串 – 永夜 https://www.shuijingwanwq.com 没有不值得去解决的问题,也没有不值得去学习的技术! Sat, 06 May 2023 01:27:19 +0000 zh-Hans hourly 1 https://wordpress.org/?v=7.0 在 Laravel 6 中,删除网址中的查询参数后,请求继续执行 https://www.shuijingwanwq.com/2023/05/06/7608/ https://www.shuijingwanwq.com/2023/05/06/7608/#respond Sat, 06 May 2023 01:27:19 +0000 query]]> query->remove]]> https://www.shuijingwanwq.com/?p=7608 浏览量: 48 1、网址:https://object.local/?oseid=2052A62hlvOV6hlqej5yS2MwoYpUxXTtMQQb ,当满足某个条件时,希望删除掉查询参数:oseid ,让网址变化为:https://object.local/ 。不希望使用 302 跳转实现。 2、具体实现如下


var_dump($request->query('oseid'));
$request->query->remove('oseid');
var_dump($request->query('oseid'));
exit;


3、打印结果如下,符合预期。如图1
打印结果如下,符合预期

图1



string(36) "2052A62hlvOV6hlqej5yS2MwoYpUxXTtMQQb" NULL


]]>
https://www.shuijingwanwq.com/2023/05/06/7608/feed/ 0