EarthSDK
    正在准备搜索索引...

    函数 parseRtsHost

    • 从 info 地址解析 host(协议 + 主机名,不含端口)。

      会先调用 resolveRtsInfoUrl 将相对路径转为完整 URL,再提取 host 部分。

      参数

      • url: string

        RTS info 地址

      返回 undefined | string

      host 字符串;解析失败返回 undefined

      parseRtsHost('http://localhost:9009/ts/info/ts01')  // => 'http://localhost'
      parseRtsHost('/ts/info/ts01') // => 'http://localhost'(取决于当前页面)