angular 中不要使用location.href

location.href = '#/HKorderList?gid='+gid+'&gname='+encodeURIComponent(gname)+'&cPeriod='+$('#current_period').text()+'&totalmoney='+$('#bet_money').text()+'&reUrl='+'/pcddBet'+'&playid='+playid+'&spid='+spid;

在单页面应用中,会导致,history 跳转两次的情况:

要使用:

 $location.url('/HKorderList?gid='+gid+'&gname='+encodeURIComponent(gname)+'&cPeriod='+$('#current_period').text()+'&totalmoney='+$('#bet_money').text()+'&reUrl='+'/pcddBet'+'&playid='+playid+'&spid='+spid);

代替!

原文地址:https://www.cnblogs.com/web-fusheng/p/7574612.html