index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div>
  3. <template v-if="isMobile">
  4. <login-mobile/>
  5. </template>
  6. <template v-else>
  7. <login/>
  8. </template>
  9. </div>
  10. </template>
  11. <script>
  12. import {Login} from '~components/login'
  13. import {LoginMobile} from '~components/mobile'
  14. export default {
  15. layout (context) {
  16. return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
  17. },
  18. // created() {
  19. // this.$http.get('/sso/login/page/style', { params: {appId: this.$route.query.appId} })
  20. // .then(response => {
  21. // console.log(response.data)
  22. // this.$store.commit('login/REQUEST_LOGIN_STYLE_SUCCESS', response.data)
  23. // }, err => {
  24. // this.$store.commit('login/REQUEST_LOGIN_STYLE_FAILURE', err)
  25. // })
  26. // },
  27. asyncData ({store, route}) {
  28. return Promise.all([
  29. store.dispatch('GetLoginStyle', {appId: route.query.appId})
  30. ])
  31. },
  32. components: {
  33. Login,
  34. LoginMobile
  35. },
  36. computed: {
  37. isMobile () {
  38. return this.$store.state.option.isMobile
  39. }
  40. }
  41. }
  42. </script>