login-auth.vue 547 B

123456789101112131415161718192021222324
  1. <template>
  2. <view></view>
  3. </template>
  4. <script>
  5. export default {
  6. onLoad() {
  7. this.$toast('登录成功')
  8. const url = uni.getStorageSync('LOGIN_REDIRECT_URL')
  9. if (url) {
  10. if (url.indexOf('tabBar') > -1) {
  11. uni.switchTab({ url })
  12. } else {
  13. uni.redirectTo({ url })
  14. }
  15. } else {
  16. uni.switchTab({ url: '/pages/tabBar/user/user' })
  17. }
  18. },
  19. beforeDestroy() {
  20. uni.removeStorageSync('LOGIN_REDIRECT_URL')
  21. }
  22. }
  23. </script>