API接口文档

上传

创建于 2021-07-27 / 4875
字体: [默认] [大] [更大]

简要描述

文件上传

接口版本

版本号 制定人 制定日期 修订日期
1.0.0 Devil 2020-03-04

请求URL

ueditor/index

请求方式

POST

公共参数

参数名 是否必须 类型 默认值 描述
application string web 请求应用、参考公共中详解
application_client_type string pc 请求客户端、参考公共中详解
token string token

请求参数

参数名 是否必须 类型 默认值 描述
upfile binary 文件二进制
action string 操作类型 详情查看上级公共描述
path_type string other 文件存储路径 详情查看上级公共描述
name string 文件原名称

操作类型 - action

参数值 描述
uploadimage 上传图片
uploadscrawl 上传涂鸦
uploadvideo 上传视频
uploadfile 上传文件

返回示例

正确时返回

{
  "msg": "success", 
  "code": 0, 
  "data": {
    "state": "SUCCESS", 
    "url": "https://xxx.com/static/upload/images/order_aftersale/5360/2018/2138/2020/03/04/1583288738485428.jpeg", 
    "path": "/wwwroot/shopxo/public/static/upload/images/order_aftersale/5360/2018/2138/2020/03/04/1583288738485428.jpeg", 
    "title": "1583288738485428.jpeg", 
    "original": "wx0a2012ebad94beff.o6zAJs_RaO7mwmwyjpA6BpcPXmuA.MXchRjxSTAZp16a1c6116bbb102570876d85effdc42a.jpeg", 
    "ext": ".jpeg", 
    "size": 10852, 
    "hash": "b74ffe3f2f938069cee5d979899ceeae1bd47f2c80e523b386452c0bbf44965f", 
    "type": "image", 
    "path_type": "order_aftersale-5360-2018-2138", 
    "id": "724"
  }
}

错误时返回

{
    "msg": "请求地址出错",
    "code": -1,
    "data": []
}

返回参数说明 -> data

参数名 是否必须 类型 描述
id int 文件 id
title string 文件名称
original string 文件原名称
path_type string 文件存储的路径
size int 文件字节大小
ext string 扩展名
type string 文件类型
url string 文件 url 地址
hash string sha256值
add_time string 添加时间 YY-mm-dd HH:ii:ss

备注

更多返回错误代码请看首页的错误代码描述

3 人点赞过