Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

配置文件 config.json 说明

潘滔 edited this page Apr 12, 2018 · 2 revisions
{
    "global": {
        /*自定义应用在各个操作系统上的文件上传路径,可使用绝对路径或相对路径(相对系统桌面)*/
        "uploadPath": {
            "windows": "upload",
            "mac": "upload",
            "linux": "upload"
        },
        /*自定义存储上传文件的文件夹命名格式*/
        "uploadForm": "yyyyMMdd",
         /*自定义应用在各个操作系统上的token保存路径,可使用绝对路径或相对路径(相对系统桌面)*/
        "tokenPath": {
            "windows": "token.json",
            "mac": "token.json",
            "linux": "token.json"
        },
        /*是否允许注册*/
        "allowRegister": true,
        /*是否允许登录*/
        "allowLogin": true,
        /*网页是否加载粒子效果(耗费客户端系统资源)*/
        "loadParticle": false,
        "anonymousUser": {
            /*匿名用户是否可以查看资源*/
            "visible": true,
            /*匿名用户是否可以下载资源*/
            "downloadable": false
        },
        /*自定义CSS样式*/
        "css": [
            {
                "selector": ".random-image",
                "style": [
                    "background-color: #800080",
                    "color: #FFF300"
                ]
            },
            {
                "selector": ".jq-nav-item a",
                "style": "color: #FFF300"
            },
            {
                "selector": ".jq-nav",
                "style": "background-color: #800080"
            },
            {
                "selector": [
                    ".content-box",
                    ".form-control"
                ],
                "style": "background: rgba(255,255,255,0.8)"
            },
            {
                "selector": ".btn",
                "style": "opacity: 0.8"
            }
        ],
        /*网页背景图片相关*/
        "background": {
            /*是否使用图片作为背景*/
            "useImage": true,
            /*图片在图片列表中的索引,如果开启了random,会被random覆盖*/
            "imageIndex": 0,
            /*图片列表,如果开启了listGenerator,会被listGenerator覆盖*/
            "imageList": [
                "https://fakedog.xyz/homedb/srcm/upload/20180123/bg_1.jpg",
                "https://fakedog.xyz/homedb/srcm/upload/20180123/bg_2.jpg",
                "https://fakedog.xyz/homedb/srcm/upload/20180123/bg_3.jpg"
            ],
            /*是否开启随机图片*/
            "random": true,
            /*图片列表生成器*/
            "listGenerator": {
                /*是否开启列表生成器(通过计数将前缀和后缀拼接起来)*/
                "enable": true,
                "prefix": "https://fakedog.xyz/image/background/anime/bg_",
                "suffix": ".jpg",
                "start": 1,
                "end": 158
            }
        }
    },
    /*用户表*/
    "user": {
        /*每次显示多少条用户数(管理员页面)*/
        "pageSize": 30,
        /*自定义用户密码长度(最小长度与最大长度)*/
        "password": {
            "minLength": 6,
            "maxLength": 20
        },
        /*注册时是否验证email*/
        "emailVerify": true,
        /*配置邮箱(可配置成自己的,默认的比较慢)*/
        "emailConfig": {
            /*smtp服务器主机*/
            "host": "mx1.hostinger.com.hk",
            /*端口*/
            "port": 587,
            /*发件人名称*/
            "personal": "efo",
            /*发件人邮箱地址*/
            "from": "[email protected]",
            /*密码或者授权的KEY*/
            "key": "123456",
            /*是否开启ssl链接*/
            "ssl": false
        },
        /*自定义注册时用户名的正则匹配规则以及提示*/
        "usernameMatch": {
            "pattern": "^[a-zA-Z][a-zA-Z0-9]{3,15}$",
            "description": "用户名只能使用长度为4到16位的英文字母和数字,且必须以字母开始"
        },
        /*自定义新注册用户的默认权限*/
        "defaultAuth": {
            "isDownloadable": true,
            "isUploadable": true,
            "isDeletable": false,
            "isUpdatable": false,
            "isVisible": true
        },
        /*自定义查询用户时的排序方式*/
        "orderBy": "id desc"
    },
    /*下载记录表*/
    "download": {
        /*每次显示多少条下载记录*/
        "pageSize": 30,
        /*查看下载记录时的排序方式*/
        "orderBy": "id desc"
    },
    /*权限表*/
    "auth": {
        /*每次显示权限记录的条数*/
        "pageSize": 30,
        /*查看权限记录的排序方式*/
        "orderBy": "id desc",
        /*用户对自己上传的文件的默认权限*/
        "default": {
            "isDownloadable": true,
            "isUploadable": true,
            "isDeletable": true,
            "isUpdatable": true,
            "isVisible": true
        }
    },
    /*文件记录表*/
    "file": {
        /*每次显示文件记录的条数*/
        "pageSize": 30,
        /*最大文件上传大小*/
        "maxSize": "1024 MB",
        /*文件标签*/
        "tag": {
            /*上传文件时是否必须要有标签*/
            "require": false,
            /*每个标签的最大字符长度*/
            "maxLength": 5,
            /*标签最大个数*/
            "maxSize": 5
        },
        /*查看文件记录时的默认排序方式*/
        "orderBy": "id desc",
        /*上传文件当文件已经存在(路径和文件名都一致)时,是否覆盖原文件*/
        "coverIfExists": false,
        /*自定义链接格式*/
        "linkRule": {
            /*在这里修改*/
            "custom": "/{year}/{month}/{day}/{randomId}{fileSuffix}",
            /*支持的格式*/
            "support": [
                "{year}",
                "{month}",
                "{day}",
                "{author}",
                "{fileName}",
                "{categoryName}",
                "{randomId}",
                "{fileSuffix}"
            ]
        },
        /*指定文件后缀匹配(正则表达式)以及提示*/
        "suffixMatch": {
            "pattern": "[a-zA-Z0-9]{0,10}",
            "description": "文件后缀只能包括数字和字母且长度不超过10"
        },
        /*自定义新上传文件的默认权限*/
        "defaultAuth": {
            "isDownloadable": true,
            "isUploadable": true,
            "isDeletable": true,
            "isUpdatable": true,
            "isVisible": true
        }
    }
}
Clone this wiki locally