index.vue 590 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <view></view>
  3. </template>
  4. <script>
  5. export default {
  6. created() {
  7. if (!uni.getStorageSync('userInfo') || uni.getStorageSync('userInfo').tenant_id == '000000') {
  8. this.$u.api.token('000000', 'admin', '704b18f7954fd548609134f03f9d5128').then(data => {
  9. setTimeout(() => {
  10. this.$u.func.login(data)
  11. }, 1000);
  12. })
  13. } else {
  14. if (uni.getStorageSync('accessToken')) {
  15. uni.reLaunch({
  16. url: '/pages/tabBar/home'
  17. })
  18. } else {
  19. uni.redirectTo({
  20. url: '/pages/login/login'
  21. })
  22. }
  23. }
  24. }
  25. }
  26. </script>