{"size": 993, "ext": "js", "max_stars_repo_path": "src/views/auth/wxLogin/wxLogin.js", "max_stars_repo_name": "sundaywill/taover-web", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/views/auth/wxLogin/wxLogin.js", "max_issues_repo_name": "sundaywill/taover-web", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/views/auth/wxLogin/wxLogin.js", "max_forks_repo_name": "sundaywill/taover-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.0666666667, "max_line_length": 67, "alphanum_fraction": 0.5236656596}
/**
 * Created by sunday on 03/11/2016.
 */
import loader from './../../../router/loader'
import service from './../../../services/auth'

export default {
  created () {
    var self = this
    if (/micromessenger/.test(navigator.userAgent.toLowerCase())) {
      var data = self.$route.query
      var jump = self.$route.query.jump
      jump = (jump == undefined) ? '/' : jump
      if (data.token != undefined) {
        service.login({ token: data.token })
        if (jump.substring(0,4) == 'http') {
          window.location.replace(jump)
        } else {
          window.router.replace(jump)
        }
      } else {
        window.router.replace(jump)
      }
    } else {
      window.router.replace('/')
    }
  },

  methods: {
    login () {
      swal({
        type: "warning",
        title: "",
        text: "登录失败，请重试\r\n",
        confirmButtonText: "我知道了",
        confirmButtonColor: "#b0afaf"
      })
    }
  },

  components: {
    VLayout: loader.layout('app')
  }
}
