举例:
访问abc.com/?abc=1的时候,点击页面上任意连接都会自动加上?abc=1
访问abc.com/?abc=1&efg=2的时候,点击页面上任意连接都会自动加上?abc=1&efg=2
客户端设置缓存,试试
做一个专门的跳转处理。
假设当前参数是?abc=1,点击某一链接,跳转到专门处理跳转的页面,比如abc.com/link.php。该php首先获取http数据包的Referer字段,获取该字段中的参数(正则匹配),最后拼接成目标链接,然后访问
window.location.search获得你的请求比如?abc=1,然后你写个js :
<input type="button" value="按钮1" attr-url="你下一个要跳转的页面" onclick="a()">
<script>
var url=window.location.search;
function a(event){
var dom = event.target;
var finalurl = dom.getattribute("attr-url")+url;
window.location.href(finalurl
}
</script>
可以通过配置路由进行跳转
routes: [{
path: "/",
name: "",
redirect: "/?abc=1&efg=2",
component: 跳转vue组件,
}]
<script>
$(function(){
$(document).on("click","a",function(){
location.href = $(this).attr("href")+location.search;
return false;
});
});
</script>