美文网首页
ionic3 logout 登出退出程序

ionic3 logout 登出退出程序

作者: 云小诺 | 来源:发表于2018-05-17 16:53 被阅读0次

    emmmmmmmmmmmmm
    我写的就特别简单。。。
    废话不说了,直接上代码了:

    logOut() {
        let alert = this.alertCtrl.create({
          title: '提示',
          subTitle: '你确定要退出账号吗?',
          buttons: [
            {
              text: '取消',
              role: 'cancel',
              handler: () => {
                this.menuCtrl.close();
              }
            },
            {
              text: '确定',
              handler: () => {
                this.menuCtrl.close();
                this.storage.clear();
                setTimeout(() => {
                  this.app.getRootNav().push(LoginPage);
                }, 500)
              }
            }
          ]
        });
        alert.present();
      }
    

    OK,就酱紫。。。

    相关文章

      网友评论

          本文标题:ionic3 logout 登出退出程序

          本文链接:https://www.haomeiwen.com/subject/xsxidftx.html