can't logout from ionic

后端 未结 3 1788
梦谈多话
梦谈多话 2021-01-06 03:03

Hi I have an issue with ionic login and logout.

Each time after logout, i can still click the back button and it will bring me back to my previous page. may i know h

3条回答
  •  Happy的楠姐
    2021-01-06 03:34

    $ionicHistory.clearCache() now returns promise so you can ensure cache is cleared. So you can call like this:

    $ionicHistory.clearCache().then(function() {
        //now you can clear history or goto another state if you need
        $ionicHistory.clearHistory();
        $ionicHistory.nextViewOptions({ disableBack: true, historyRoot: true });
        $state.go('login');
    })
    

    There is no need for the above timeout like things.

    credit goes to

提交回复
热议问题