
Page({

  data: {
    isLogin: true,
    
  },

  onLoad() {
    this.getToken();
  },
  async getToken() {
    const Token = await wx.getStorageSync('access_token');
    console.log(Token)
    this.setData({
      isLogin: Token ? true : false,
    })
  },
  handelClick(e) {
    console.log(e)
  },

  async onShow() {
    this.getToken();
  },

  onReady(){
    this.getToken();
  },
  onLogin(){
    wx.navigateTo({
      url: '/pages/login/login',
    });
  },

  

  
  logOut(){
    wx.removeStorageSync('access_token');
    this.setData({
      isLogin: false,
    })
  }

});
