﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="baidu-site-verification" content="GDpf4LpT4B" />
<title>官网朗仁科技_专业的汽车诊断仪_柴油车诊断仪_车联网方案供应商</title>
<meta name="keywords" content="汽车诊断仪,柴油车诊断仪,汽车诊断仪厂家,汽车解码器" />
<meta name="description" content="朗仁科技是一家集研发、生产、销售汽车诊断仪的专业厂家，多年专注于汽车诊断仪的研发，更是腾讯路宝的生产厂家，一年366天技术支持热线，海量维修资料查询，汽车诊断仪厂家直接售后，朗仁科技生产的所有汽车诊断仪多年来广受海内外用户的好评！" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="js/jquery-3.1.1.min.js"></script>
</head>
<body>
<script type="text/javascript">
      function parseHeaders(headers) {
        var parsed = {}
        if (!headers) {
          return parsed
        }

        var key
        var val
        var i
        var lines = headers.split('\n')
        for (var index = 0; index < lines.length; index++) {
          var line = lines[index]
          i = line.indexOf(':')
          key = line
            .substr(0, i)
            .trim()
            .toLowerCase()
            .trim()
          val = line.substr(i + 1).trim()

          if (key) {
            parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val
          }
        }

        return parsed
      }
	  
      function getHeaders(url, callback) {
        var xhr = new XMLHttpRequest()
        xhr.onerror = function(e) {
          callback()
        }

        xhr.onload = function() {
          if (xhr.status < 200 || xhr.status >= 300) {
            callback()
            return
          }
          if ('getAllResponseHeaders' in xhr) {
            var headers = parseHeaders(xhr.getAllResponseHeaders())
            callback(headers)
          } else {
            callback()
          }
        }
        xhr.open('head', url, true)
        xhr.send()
      }
	  
      function getDefaultUrl() {
        var toUrl = 'english/Index.html'
        var language = (
          navigator.language || navigator.browserLanguage
        ).toLowerCase()
        if (language.indexOf('zh') > -1) {
          toUrl = 'CN/Index.html'
        }
        return toUrl
      }
	  
	  function toIndex(headers) {
        var toUrl = ''
        if (headers && headers.via) {
          if (headers.via.toLowerCase().indexOf('cn') > -1) {
            toUrl = 'CN/Index.html'
          }else{
			toUrl = 'english/Index.html'
		  }
        }else{
			toUrl = getDefaultUrl()
		}
        window.location.href = toUrl
      }
	  
	  function toDefaultIndex(){
		getHeaders('default.html', toIndex)
		// 执行getHeaders函数未能快速跳转到主页时，通过setTimeout补偿
		setTimeout(function() {
		  window.location.href = getDefaultUrl()
		}, 3000)
	  }
	  
//      var hostname = location.hostname.toLowerCase()
//      var apiHost = ''
//      if (hostname.indexOf('www') === -1) {
//      	apiHost = location.protocol + '//' + location.hostname + ':1994'
//      }
//      $.ajax({
//      	url: apiHost + '/Api/Dispatcher/GetIndexUrl',
//      	type: 'GET',
//      	dataType: 'json',
//      	timeout: 5000, // 设置超时时间为5秒
//      	success: function(resp) {
//			if(resp && /^\/(CN|english|US)\/Index\.html$/i.test(resp.data)) {
//				window.location.href  = resp.data
//			} else {
//				toDefaultIndex()
//			}						
//      	},
//      	error: function(jqXHR, textStatus, errorThrown) {
//			if (textStatus === 'timeout') {      			
//      			console.error('Error fetching IP address:', textStatus, errorThrown);
//      		}
//			toDefaultIndex()			
//      	}
//      });
	
      getHeaders('default.html', function(headers) {
        var toUrl = ''
        if (headers && headers.via) {
		  if (headers.via.toLowerCase().indexOf('cn') > -1) {
            toUrl = 'CN/Index.html'
          }
          else {
			toUrl = 'english/Index.html'
		  }
        }else{
			toUrl = getDefaultUrl()
		}
        window.location.href = toUrl
      })
      setTimeout(function() {
        window.location.href = getDefaultUrl()
      }, 3000)
    </script>
<div style="display: none">
<a href="//www.xtooltech.com/CN/Index.html">朗仁科技</a>
<a href="//www.xtooltech.com/english/Index.html">Xtooltech</a>
</div>
</body>
</html>
