import { loadBackendAuthTokens } from '../../utils/backendAuth'

Page({
  onLoad() {
    this.redirectToDefaultEntry()
  },

  redirectToDefaultEntry() {
    const tokens = loadBackendAuthTokens()
    const url = tokens && tokens.accessToken
      ? '/pages/home/home'
      : '/pages/login/login'
    wx.redirectTo({ url })
  },
})
