| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| msg | string | 是 | 二维码内容(网址、文本等),支持任意字符串。 | https://xiaoapi.cn |
| size | integer | 否 | 二维码矩阵点大小,值越大二维码越精细(建议 1~10)。 | 8 |
| margin | integer | 否 | 二维码内部的静区(留白)宽度,单位:像素点。 | 3 |
| fgcolor | string | 否 | 前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。 | %23FFCCCC |
| bgcolor | string | 否 | 背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。 | %23800080 |
| border | integer | 否 | 外边框宽度(像素),设为 0 表示无边框。 | 3 |
| bordercolor | string | 否 | 外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。 | %2300FF00 |
| radius | integer | 否 | 二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。 | 10 |
[
{
"name": "msg",
"type": "string",
"required": true,
"description": "二维码内容(网址、文本等),支持任意字符串。",
"example": "https://xiaoapi.cn"
},
{
"name": "size",
"type": "integer",
"required": false,
"description": "二维码矩阵点大小,值越大二维码越精细(建议 1~10)。",
"example": "8"
},
{
"name": "margin",
"type": "integer",
"required": false,
"description": "二维码内部的静区(留白)宽度,单位:像素点。",
"example": "3"
},
{
"name": "fgcolor",
"type": "string",
"required": false,
"description": "前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。",
"example": "%23FFCCCC"
},
{
"name": "bgcolor",
"type": "string",
"required": false,
"description": "背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。",
"example": "%23800080"
},
{
"name": "border",
"type": "integer",
"required": false,
"description": "外边框宽度(像素),设为 0 表示无边框。",
"example": "3"
},
{
"name": "bordercolor",
"type": "string",
"required": false,
"description": "外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。",
"example": "%2300FF00"
},
{
"name": "radius",
"type": "integer",
"required": false,
"description": "二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。",
"example": "10"
}
]
{"openapi":"3.1.1","info":{"title":"二维码生成","description":"提供一串文字或者一个url即可生成一个简单实用的二维码。","version":"1.0.0"},"paths":{"/v1/zs_ewm.php":{"get":{"summary":"二维码生成","description":"提供一串文字或者一个url即可生成一个简单实用的二维码。","parameters":[{"name":"msg","in":"query","required":true,"schema":{"type":"string","example":"https://xiaoapi.cn"},"description":"二维码内容(网址、文本等),支持任意字符串。"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","example":8},"description":"二维码矩阵点大小,值越大二维码越精细(建议 1~10)。"},{"name":"margin","in":"query","required":false,"schema":{"type":"integer","example":3},"description":"二维码内部的静区(留白)宽度,单位:像素点。"},{"name":"fgcolor","in":"query","required":false,"schema":{"type":"string","example":"%23FFCCCC"},"description":"前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。"},{"name":"bgcolor","in":"query","required":false,"schema":{"type":"string","example":"%23800080"},"description":"背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。"},{"name":"border","in":"query","required":false,"schema":{"type":"integer","example":3},"description":"外边框宽度(像素),设为 0 表示无边框。"},{"name":"bordercolor","in":"query","required":false,"schema":{"type":"string","example":"%2300FF00"},"description":"外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。"},{"name":"radius","in":"query","required":false,"schema":{"type":"integer","example":10},"description":"二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。"}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"二维码生成","description":"提供一串文字或者一个url即可生成一个简单实用的二维码。","parameters":[{"name":"msg","in":"query","required":true,"schema":{"type":"string","example":"https://xiaoapi.cn"},"description":"二维码内容(网址、文本等),支持任意字符串。"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","example":8},"description":"二维码矩阵点大小,值越大二维码越精细(建议 1~10)。"},{"name":"margin","in":"query","required":false,"schema":{"type":"integer","example":3},"description":"二维码内部的静区(留白)宽度,单位:像素点。"},{"name":"fgcolor","in":"query","required":false,"schema":{"type":"string","example":"%23FFCCCC"},"description":"前景色,即二维码模块(黑色方块)的颜色。支持十六进制(可省略 # 或使用 %23 编码)。"},{"name":"bgcolor","in":"query","required":false,"schema":{"type":"string","example":"%23800080"},"description":"背景色,二维码空白区域的颜色。同样支持十六进制(可省略 # 或编码)。"},{"name":"border","in":"query","required":false,"schema":{"type":"integer","example":3},"description":"外边框宽度(像素),设为 0 表示无边框。"},{"name":"bordercolor","in":"query","required":false,"schema":{"type":"string","example":"%2300FF00"},"description":"外边框的颜色(当 border>0 时生效),支持十六进制(可省略 # 或编码)。"},{"name":"radius","in":"query","required":false,"schema":{"type":"integer","example":10},"description":"二维码圆角半径(像素),设为 0 表示直角。注意:半径过大会破坏定位图案,影响扫码识别,建议 ≤15。"}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"servers":[{"url":"http://xiaoapi.cn","description":"当前访问入口(http)"}]}
图片资源
暂无详细文档
暂无代码示例。管理员可在后台用 AI 生成或手动编写。
// 结果将在此处显示