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);

代替!

 

posted @ 2017-09-22 14:13  快乐的咸鱼  阅读(306)  评论(0编辑  收藏  举报