import router from '@/router/index';

/**
 * 跳转页面
 * @param path    路由地址
 * @param query   参数
 * @param isBlank 是否新页面打开
 */
export function jumpPage(path, query = null, isBlank = false) {
  if (path) {
    if (!isBlank) {
      router.push({path, query})
    } else {
      if (path.indexOf('http') !== -1) {
        window.open(path, '_blank')
      } else {
        let routeUrl = router.resolve({path, query})
        window.open(routeUrl.href, '_blank')
      }
    }
  }
}