Commit d99ae3e3 authored by 许珑标's avatar 许珑标

导出功能优化

parent f0ade724
......@@ -33,13 +33,11 @@ service.interceptors.request.use(config => {
// 请求参数加密
if (process.env.VUE_APP_AES_ENCRYPT_ENABLED == 'true') {
if (config.data) {
console.log(JSON.stringify(config.data));
config.data = {
// 加密参数
dataParams: encodeURIComponent(aes.encrypt(JSON.stringify(config.data)))
}
} else if (config.params) {
console.log(JSON.stringify(config.params));
config.params = {
// 加密参数
dataParams: encodeURIComponent(aes.encrypt(JSON.stringify(config.params)))
......@@ -62,6 +60,7 @@ service.interceptors.request.use(config => {
config.url = url;
}
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
console.log(config);
const requestObj = {
url: config.url,
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
......@@ -158,8 +157,6 @@ service.interceptors.response.use(res => {
export function download(url, params, filename) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
return service.post(url, params, {
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then(async (data) => {
const isLogin = await blobValidate(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment