> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 跨域资源共享（CORS）

> 为知行之桥系统 API 配置 CORS，以允许基于浏览器的客户端连接。

export const CommonCors = () => <>
    <table>
      <thead>
        <tr><th>设置</th><th>描述</th></tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>启用跨源资源共享 (CORS)</strong></td>
          <td>是否启用 CORS。仅当选中此框时，其余选项才可用。</td>
        </tr>
        <tr>
          <td><strong>允许所有不带 '*' 的域</strong></td>
          <td>如果启用，域来源不限于特定列表。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Origin</strong></td>
          <td>要允许的以逗号分隔的域来源列表。作为 HTTP 响应消息头包含在内。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Credentials</strong></td>
          <td>跨域请求中是否允许用户凭据（例如 cookie）。作为 HTTP 响应消息头包含在内。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Methods</strong></td>
          <td>允许的以逗号分隔的方法列表。作为 HTTP 响应消息头包含在内。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Allow-Headers</strong></td>
          <td>允许的消息头的逗号分隔列表。作为 HTTP 响应消息头包含在内。</td>
        </tr>
        <tr>
          <td><strong>Access-Control-Max-Age</strong></td>
          <td>可以缓存 Access-Control 响应消息头值的最大持续时间（以秒为单位）。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const siteNameShort = "知行之桥";

您可以通过导航到[安全选项卡](../getting-started/administration/settings/security)的[系统 API](./admin-api)部分，为系统 API 配置跨域资源共享 (CORS)。CORS 允许基于浏览器的客户端连接到 {siteNameShort}。如果没有 CORS，基于浏览器的脚本将无法连接到 {siteNameShort}，因为浏览器强制执行了同源策略。此策略限制客户端脚本和文档加载其来源之外的资源。脚本的来源由协议、主机和端口组成。

<CommonCors />
