Option:get

获取站点全局设置参数。

HTTP 请求

GET /api/options

响应

全局设置参数列表

示例

{
  "code": 0,
  "data": {
    "answer_can_delete": false,
    "answer_can_delete_before": 0,
    "answer_can_delete_only_no_comment": false,
    "answer_can_edit": false,
    "answer_can_edit_before": 0,
    "answer_can_edit_only_no_comment": false,
    "article_can_delete": false,
    "article_can_delete_before": 0,
    "article_can_delete_only_no_comment": false,
    "article_can_edit": false,
    "article_can_edit_before": 0,
    "article_can_edit_only_no_comment": false,
    "cache_memcached_host": "134.56.2.11",
    "cache_memcached_password": "gfdcg3234",
    "cache_memcached_port": 12,
    "cache_memcached_username": "username",
    "cache_prefix": "mc_",
    "cache_redis_host": "123.33.5.11",
    "cache_redis_password": "gdf234",
    "cache_redis_port": 11,
    "cache_redis_username": "username",
    "cache_type": "redis",
    "comment_can_delete": false,
    "comment_can_delete_before": 0,
    "comment_can_edit": false,
    "comment_can_edit_before": 0,
    "language": "zh-CN",
    "question_can_delete": false,
    "question_can_delete_before": 0,
    "question_can_delete_only_no_answer": false,
    "question_can_delete_only_no_comment": false,
    "question_can_edit": false,
    "question_can_edit_before": 0,
    "question_can_edit_only_no_answer": false,
    "question_can_edit_only_no_comment": false,
    "search_third": "google",
    "search_type": "third",
    "site_description": "最好的开源社区系统",
    "site_gongan_beian": "浙公网安备 653673547653475346号",
    "site_icp_beian": "浙ICP备65465464号-1",
    "site_keywords": "Material Design,community",
    "site_name": "MDClub",
    "site_static_url": "https://mdclub.org/static",
    "smtp_host": "144.33.6.12",
    "smtp_password": "fsadf443",
    "smtp_port": 465,
    "smtp_reply_to": "example@example.com",
    "smtp_secure": "ssl",
    "smtp_username": "noreply@mail.example.com",
    "storage_aliyun_access_id": "fdgdfgdsfg34534",
    "storage_aliyun_access_secret": "tgfdgfsdg435g",
    "storage_aliyun_bucket": "mdclub",
    "storage_aliyun_dir": "upload",
    "storage_aliyun_endpoint": "oss-cn-hangzhou.aliyuncs.com",
    "storage_ftp_host": "122.33.1.76",
    "storage_ftp_passive": true,
    "storage_ftp_password": "fdsgdf67",
    "storage_ftp_port": 21,
    "storage_ftp_dir": "/mdclub",
    "storage_ftp_ssl": true,
    "storage_ftp_username": "username",
    "storage_local_dir": "/mdclub/storage",
    "storage_qiniu_access_id": "gfdgdfg345345",
    "storage_qiniu_access_secret": "gffhgfdhdfghdgf456645",
    "storage_qiniu_bucket": "mdclub",
    "storage_qiniu_dir": "upload",
    "storage_qiniu_zone": "z0",
    "storage_sftp_host": "122.33.4.12",
    "storage_sftp_password": "43fdfg",
    "storage_sftp_port": 22,
    "storage_sftp_dir": "/mdclub/storage",
    "storage_sftp_username": "username",
    "storage_type": "aliyun",
    "storage_upyun_bucket": "mdclub",
    "storage_upyun_dir": "upload",
    "storage_upyun_operator": "username",
    "storage_upyun_password": "gfdg434",
    "storage_url": "https://mdclub.org/static",
    "theme": "material"
  }
}

参数说明

参数名 类型 说明
code integer

无任何错误时,状态码为 0

data.answer_can_delete boolean

回答作者是否可删除回答。

false 时,不允许删除; 为 true 时,在满足 answer_can_delete_beforeanswer_can_delete_only_no_comment 的条件时可删除。

data.answer_can_delete_before integer

在发表后多少秒内,允许作者删除回答(为 0 时表示不做限制)。仅在 answer_can_deletetrue 时该参数才有效。

data.answer_can_delete_only_no_comment boolean

是否仅在没有评论时,允许作者删除回答。仅在 answer_can_deletetrue 时该参数才有效。

data.answer_can_edit boolean

回答作者是否可编辑回答。

false 时,不允许编辑; 为 true 时,在满足 answer_can_edit_beforeanswer_can_edit_only_no_comment 的条件时可编辑。

data.answer_can_edit_before integer

在发表后的多少秒内,允许作者编辑回答(为 0 时表示不做限制)。仅在 answer_can_edittrue 时该参数才有效。

data.answer_can_edit_only_no_comment boolean

是否仅在没有评论时,允许作者编辑回答。仅在 answer_can_edittrue 时该参数才有效。

data.article_can_delete boolean

文章作者是否可删除文章。

false 时,不允许删除; 为 true 时,在满足 article_can_delete_beforearticle_can_delete_only_no_comment 的条件时可删除。

data.article_can_delete_before integer

在发表后多少秒内,允许作者删除文章(为 0 时表示不做限制)。仅在 article_can_deletetrue 时该参数才有效。

data.article_can_delete_only_no_comment boolean

仅在没有评论时,允许作者删除文章。仅在 article_can_deletetrue 时该参数才有效。

data.article_can_edit boolean

文章作者是否可编辑文章。

false 时,不允许编辑; 为 true 时,在满足 article_can_edit_beforearticle_can_edit_only_no_comment 的条件时可编辑。

data.article_can_edit_before integer

在发表后的多少秒内,允许作者编辑文章(为 0 时表示不做限制)。仅在 article_can_edittrue 时该参数才有效。

data.article_can_edit_only_no_comment boolean

仅在没有评论时,允许作者编辑文章。仅在 article_can_edittrue 时该参数才有效。

data.cache_memcached_host string

🔐Memcached 服务器地址

data.cache_memcached_password string

🔐Memcached 密码

data.cache_memcached_port integer

🔐Memcached 端口号

data.cache_memcached_username string

🔐Memcached 用户名

data.cache_prefix string

🔐缓存键名前缀(只能包含字符 -+.A-Za-z0-9)

data.cache_redis_host string

🔐Redis 服务器地址

data.cache_redis_password string

🔐Redis 密码

data.cache_redis_port integer

🔐Redis 端口号

data.cache_redis_username string

🔐Redis 用户名

data.cache_type string

🔐缓存类型

取值范围包括:pdo, redis, memcached

data.comment_can_delete boolean

评论作者是否可删除评论。

false 时,不允许删除; 为 true 时,在满足 comment_can_delete_before 的条件时可删除。

data.comment_can_delete_before integer

在发表后多少秒内,允许作者删除评论(为 0 时表示不做限制)。仅在 comment_can_deletetrue 时该参数才有效。

data.comment_can_edit boolean

评论作者是否可编辑评论。

false 时,不允许编辑; 为 true 时,在满足 comment_can_edit_before 的条件时可编辑。

data.comment_can_edit_before integer

在发表后的多少秒内,允许作者编辑评论(为 0 时表示不做限制)。仅在 comment_can_edittrue 时该参数才有效。

data.language string

系统语言

取值范围包括:en, pl, ru, zh-CN, zh-TW

data.question_can_delete boolean

提问作者是否可删除提问。

false 时,不允许删除; 为 true 时,在满足 question_can_delete_beforequestion_can_delete_only_no_answerquestion_can_delete_only_no_comment 的条件时可删除。

data.question_can_delete_before integer

在发表后多少秒内,允许作者删除提问(为 0 时表示不做限制)。仅在 question_can_deletetrue 时该参数才有效。

data.question_can_delete_only_no_answer boolean

仅在没有回答时,允许作者删除提问。仅在 question_can_deletetrue 时该参数才有效。

data.question_can_delete_only_no_comment boolean

仅在没有评论时,允许作者删除提问。仅在 question_can_deletetrue 时该参数才有效。

data.question_can_edit boolean

提问作者是否可编辑提问。

false 时,不允许编辑; 为 true 时,在满足 question_can_edit_beforequestion_can_edit_only_no_answerquestion_can_edit_only_no_comment 的条件时可编辑。

data.question_can_edit_before integer

在发表后的多少秒内,允许作者编辑提问(为 0 时表示不做限制)。仅在 question_can_edittrue 时该参数才有效。

data.question_can_edit_only_no_answer boolean

仅在没有回答时,允许作者编辑提问。仅在 question_can_edittrue 时该参数才有效。

data.question_can_edit_only_no_comment boolean

仅在没有评论时,允许作者编辑提问。仅在 question_can_edittrue 时该参数才有效。

data.search_third string

第三方搜索的名称

取值范围包括:google, bing, sogou, 360, baidu

data.search_type string

搜索引擎类型

取值范围包括:third

data.site_description string

站点简介

data.site_gongan_beian string

站点公安备案号

data.site_icp_beian string

站点 ICP 备案号

data.site_keywords string

站点关键词

data.site_name string

站点名称

data.site_static_url string

🔐静态资源 URL 地址

data.smtp_host string

🔐SMTP 服务器地址

data.smtp_password string

🔐SMTP 密码

data.smtp_port integer

🔐SMTP 端口

data.smtp_reply_to string

🔐SMTP 回信地址

data.smtp_secure string

🔐SMTP 加密方式

取值范围包括:ssl, tls,

data.smtp_username string

🔐SMTP 账户

data.storage_aliyun_access_id string

🔐阿里云 AccessKey ID

data.storage_aliyun_access_secret string

🔐阿里云 Access Key Secret

data.storage_aliyun_bucket string

🔐阿里云 OSS 的 Bucket 名称

data.storage_aliyun_dir string

🔐阿里云 OSS 的存储子目录

data.storage_aliyun_endpoint string

🔐阿里云 OSS 的 EndPoint

data.storage_ftp_host string

🔐FTP 服务器地址

data.storage_ftp_passive boolean

🔐是否使用被动传输模式。true(被动模式);false(主动模式)

data.storage_ftp_password string

🔐FTP 密码

data.storage_ftp_port integer

🔐FTP 端口号

data.storage_ftp_dir string

🔐FTP 存储目录

data.storage_ftp_ssl boolean

🔐FTP 是否启用 SSL。true(启用);false(不启用)

data.storage_ftp_username string

🔐FTP 用户名

data.storage_local_dir string

🔐本地文件存储目录

data.storage_qiniu_access_id string

🔐七牛云 AccessKey

data.storage_qiniu_access_secret string

🔐七牛云 SecretKey

data.storage_qiniu_bucket string

🔐七牛云 Bucket

data.storage_qiniu_dir string

🔐七牛云的存储子目录

data.storage_qiniu_zone string

🔐FTP 存储区域。z0(华东);z1(华北);z2(华南);na0(北美);as0(东南亚)

取值范围包括:z0, z1, z2, na0, as0

data.storage_sftp_host string

🔐SFTP 服务器地址

data.storage_sftp_password string

🔐SFTP 密码

data.storage_sftp_port integer

🔐SFTP 端口号

data.storage_sftp_dir string

🔐SFTP 存储目录

data.storage_sftp_username string

🔐SFTP 用户名

data.storage_type string

🔐存储类型

取值范围包括:local, ftp, sftp, aliyun, upyun, qiniu

data.storage_upyun_bucket string

🔐又拍云 Bucket

data.storage_upyun_dir string

🔐又拍云的存储子目录

data.storage_upyun_operator string

🔐又拍云操作员账号

data.storage_upyun_password string

🔐又拍云操作员密码

data.storage_url string

🔐本地文件访问链接

data.theme string

🔐主题名称