---
title: 设置
description: >-
  面板配置与用户凭据。所有端点均位于 /panel/api/setting 之下，需要已登录的会话或 Bearer 令牌。
full: true
_openapi:
  preload:
    - ./public/openapi.json
  toc:
    - depth: 2
      title: >-
        返回每一项面板设置：Web 服务器、Telegram 机器人、订阅、安全、LDAP。即“设置”页面所编辑的完整 JSON
        数据。
      url: >-
        #return-every-panel-setting-web-server-telegram-bot-subscription-security-ldap-the-full-json-blob-that-the-settings-page-edits
    - depth: 2
      title: >-
        根据请求主机返回计算得出的默认设置。可用于预览全新安装将采用的配置。
      url: >-
        #return-the-computed-default-settings-based-on-the-request-host-useful-to-preview-what-a-fresh-install-would-use
    - depth: 2
      title: >-
        一次性保存全部设置。请求体与 /all 返回的结构一致。无效值（端口错误、证书对缺失等）会在写入前被拒绝。
      url: >-
        #persist-every-setting-at-once-the-body-mirrors-the-shape-returned-by-all-invalid-values-bad-ports-missing-cert-pairs-etc-are-rejected-before-write
    - depth: 2
      title: >-
        更改面板管理员的用户名和密码。需要提供当前凭据以供验证。成功后会话将以新值刷新。
      url: >-
        #change-the-panel-admin-username-and-password-requires-the-current-credentials-for-verification-the-session-is-refreshed-with-the-new-values-on-success
    - depth: 2
      title: >-
        在 3 秒缓冲期后重启整个 3x-ui 进程。连接会立即断开；面板将在约 5-10 秒后重新上线。
      url: >-
        #restart-the-entire-3x-ui-process-after-a-3-second-grace-period-the-connection-drops-immediately-the-panel-comes-back-online-5-10-seconds-later
    - depth: 2
      title: >-
        测试 SMTP 连接，并按阶段（连接、认证、发送）逐步报告。返回包含阶段和消息的结构化结果。
      url: >-
        #test-smtp-connection-with-stage-by-stage-reporting-connect-auth-send-returns-structured-result-with-stage-and-message
    - depth: 2
      title: >-
        通过向已配置的聊天发送一条测试消息来测试 Telegram 机器人连接。
      url: >-
        #test-telegram-bot-connection-by-sending-a-test-message-to-the-configured-chat
    - depth: 2
      title: >-
        返回随此面板版本一同提供的内置默认 Xray JSON 配置模板。
      url: >-
        #return-the-built-in-default-xray-json-config-template-that-ships-with-this-panel-version
  structuredData:
    headings:
      - content: >-
          返回每一项面板设置：Web 服务器、Telegram 机器人、订阅、安全、LDAP。即“设置”页面所编辑的完整 JSON
          数据。
        id: >-
          return-every-panel-setting-web-server-telegram-bot-subscription-security-ldap-the-full-json-blob-that-the-settings-page-edits
      - content: >-
          根据请求主机返回计算得出的默认设置。可用于预览全新安装将采用的配置。
        id: >-
          return-the-computed-default-settings-based-on-the-request-host-useful-to-preview-what-a-fresh-install-would-use
      - content: >-
          一次性保存全部设置。请求体与 /all 返回的结构一致。无效值（端口错误、证书对缺失等）会在写入前被拒绝。
        id: >-
          persist-every-setting-at-once-the-body-mirrors-the-shape-returned-by-all-invalid-values-bad-ports-missing-cert-pairs-etc-are-rejected-before-write
      - content: >-
          更改面板管理员的用户名和密码。需要提供当前凭据以供验证。成功后会话将以新值刷新。
        id: >-
          change-the-panel-admin-username-and-password-requires-the-current-credentials-for-verification-the-session-is-refreshed-with-the-new-values-on-success
      - content: >-
          在 3 秒缓冲期后重启整个 3x-ui 进程。连接会立即断开；面板将在约 5-10 秒后重新上线。
        id: >-
          restart-the-entire-3x-ui-process-after-a-3-second-grace-period-the-connection-drops-immediately-the-panel-comes-back-online-5-10-seconds-later
      - content: >-
          测试 SMTP 连接，并按阶段（连接、认证、发送）逐步报告。返回包含阶段和消息的结构化结果。
        id: >-
          test-smtp-connection-with-stage-by-stage-reporting-connect-auth-send-returns-structured-result-with-stage-and-message
      - content: >-
          通过向已配置的聊天发送一条测试消息来测试 Telegram 机器人连接。
        id: >-
          test-telegram-bot-connection-by-sending-a-test-message-to-the-configured-chat
      - content: >-
          返回随此面板版本一同提供的内置默认 Xray JSON 配置模板。
        id: >-
          return-the-built-in-default-xray-json-config-template-that-ships-with-this-panel-version
    contents: []
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

export default function Layout(props) {
  const { APIPage, OpenAPIPage } = props.components ?? {};
  // "APIPage" is the old name from v10, this allows both for backward compatibility
  const Comp = OpenAPIPage ?? APIPage;
  return (
    <>
      {props.children}
      <Comp document="./public/openapi.json" webhooks={[]} operations={[{"path":"/panel/api/setting/all","method":"post"},{"path":"/panel/api/setting/defaultSettings","method":"post"},{"path":"/panel/api/setting/update","method":"post"},{"path":"/panel/api/setting/updateUser","method":"post"},{"path":"/panel/api/setting/restartPanel","method":"post"},{"path":"/panel/api/setting/testSmtp","method":"post"},{"path":"/panel/api/setting/testTgBot","method":"post"},{"path":"/panel/api/setting/getDefaultJsonConfig","method":"get"}]} showTitle />
    </>
  );
}
