From 862b6cf69dc925a6138a7ebf79b782a5d7791202 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 一月 2020 12:13:52 +0800 Subject: [PATCH] 2020-01-03 --- src/api/index.js | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 7ab56c4..9d6ecac 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -12,6 +12,8 @@ config.method = 'post' if (config.url.includes('LoginAndRedirect') || config.url.includes('getjsonresult')) { config.data = qs.stringify(config.data) + } else if (config.url.includes('Upload')) { + config.headers = { 'Content-Type': 'multipart/form-data' } } else { config.headers.token = sessionStorage.getItem('TOKEN') || '' config.data = JSON.stringify(config.data) @@ -251,6 +253,20 @@ } /** + * @description 鏂囦欢涓婁紶 + */ + getFileUpload (file) { + const param = new FormData() + param.append('file', file) + param.append('RootPath', 'Content/images/upload/') + + return axios({ + url: '/zh-CN/Home/Upload', + data: param + }) + } + + /** * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 * @param {String} MenuNo 椤甸潰鑿滃崟鍙傛暟 */ -- Gitblit v1.8.0