From c4fb80d06bb06638f0cd2d962c60063e0727f4f2 Mon Sep 17 00:00:00 2001 From: ghusermoon <2673031505@qq.com> Date: Tue, 7 Jul 2020 17:48:20 +0800 Subject: [PATCH] api --- README.md | 9 +++++++++ static/js/common.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f08d277..73e2455 100644 --- a/README.md +++ b/README.md @@ -40,4 +40,13 @@ * @return { String } 处理好的富文本 */ unescapeHTML(temp){} + +/** +* 上传文件(只能单文件上传) +* @param { String } url 服务器 url +* @param { String } filePath 要上传文件资源的路径 +* @param { String } type 上传文件验证类型 默认: img 可选: video +* @return { object } promise 对象 resolve 为文件服务器地址 reject 为错误信息 +*/ +uploadFile({ url, filePath, type = 'img' } = {}) {} ``` \ No newline at end of file diff --git a/static/js/common.js b/static/js/common.js index cd751b9..e1a3e8e 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -12,7 +12,7 @@ const common = { /** * 上传文件(只能单文件上传) * @param { String } url 服务器 url - * @param { String } filePath 要上传文件资源的路径(单文件上传) + * @param { String } filePath 要上传文件资源的路径 * @param { String } type 上传文件验证类型 默认: img 可选: video * @return { object } promise 对象 resolve 为文件服务器地址 reject 为错误信息 */