TrustedServers

TrustedServers()

包含所有受信任的服务器的单例。认证信息将随任何请求一起发送到这些服务器。
See:

Methods

staticCesium.TrustedServers.add(host, port)

将受信任的服务器添加到注册表。
Name Type Description
host String 要添加的主机。
port Number 用于访问主机的端口。
Example:
// 添加受信任的服务器。
TrustedServers.add('my.server.com', 80);

staticCesium.TrustedServers.clear()

清理注册表。
Example:
// 删除受信任的服务器。
TrustedServers.clear();

staticCesium.TrustedServers.contains(url)boolean

测试服务器是否受信任。如果该服务器包含在url中,那么它必须已经添加了端口。
Name Type Description
url String 要根据受信任列表测试的url
Returns:
如果url受信任,则返回true,否则返回false。
Example:
// 添加服务器
TrustedServers.add('my.server.com', 81);

// 检查服务器是否受信任
if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
    // my.server.com:81 is trusted
}
if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
    // my.server.com isn't trusted
}

staticCesium.TrustedServers.remove(host, port)

从注册表中删除受信任的服务器
Name Type Description
host String 要删除的主机。
port Number 用于访问主机的端口。
Example:
// 删除受信任的服务器
TrustedServers.remove('my.server.com', 80);