>[danger] 本框架封装文件上传兼容微擎版、独立版
| 状态码 (code) | 描述 |
| --- | --- |
| 200 | 上传成功 |
| 201 | 上传失败 |
>[danger] 文件上传接口
+ 上传图片(URL地址)
+ 只支持上传 jpg,jpeg,png,gif 后缀的文件
```
http://me.cy/app/index.php?i=2&c=entry&do=admin&m=lingchi_dev&s=/upload/image
```
```
{
"code": 200,
"msg": "上传成功",
"url": "https://test.itqaq.com/lingchi_dev/2/20210701/7b6df6f67d4598f03e75cd0c56da025fdb6c9c35.jpg"
}
```
+ 上传图片(绝对路径)
+ 只支持上传 jpg,jpeg,png,gif 后缀的文件
```
http://me.cy/app/index.php?i=2&c=entry&do=admin&m=lingchi_dev&s=/upload/root
```
```
{
"code": 200,
"msg": "上传成功",
"url": "/Users/liang/Sites/me/attachment/lingchi_dev/2/image/20210701/e1bda7bf86fb2494235e80460bb8042a.jpg",
"domain": "http://me.cy/attachment/lingchi_dev/2/image/20210701/e1bda7bf86fb2494235e80460bb8042a.jpg"
}
```
+ 上传证书(微信商户号证书)
+ 只支持上传 pem 后缀的文件
```
http://me.cy/app/index.php?i=2&c=entry&do=admin&m=lingchi_dev&s=/upload/cert
```
```
{
"code": 200,
"msg": "上传成功",
"url": "/Users/liang/Sites/me/attachment/lingchi_dev/2/cert/20210701/88354cb2ee7815ff9b23fc602f124846.pem"
}
```
>[danger] 上传失败时返回值示例
```
{
"code": 201,
"msg": "证书文件后缀错误"
}
```