When the page returns, perform a forced refresh

performanceNavigation.type 

The return value should be one of 0, 1, 2. Corresponding to three enumeration values:

0 :  TYPE_NAVIGATE   (The user accesses the page through conventional navigation methods, such as clicking a link, or the general get method.)

1 :  TYPE_RELOAD   (the user accesses the page by refreshing, including JS calling the refresh interface, etc.)

2 :  TYPE_BACK_FORWARD  (the user visits this page through the back button)

$(document).ready(function(){
    var pagNum=performance.navigation.type;
     if(pagNum==2){
         document.location.reload();
    }
 });

Guess you like

Origin blog.csdn.net/weixin_57092157/article/details/129851165