From b900c5fe83941138217826ea34218ccd45f03693 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Tue, 27 Feb 2024 18:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wishingStar/wishingStar.js | 8 +++----- src/utils/system-helper.js | 9 +++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/api/wishingStar/wishingStar.js b/src/api/wishingStar/wishingStar.js index 3931301..cf3e182 100644 --- a/src/api/wishingStar/wishingStar.js +++ b/src/api/wishingStar/wishingStar.js @@ -1,5 +1,6 @@ import request from '@/utils/request'; import qs from 'qs'; +import { genQueryParam } from '@/utils/system-helper'; // ==================================许愿礼物配置==================================== // 表单 @@ -70,9 +71,6 @@ export const promiseStarUserRecordPage = query => { }); }; export const promiseStarUserRecordExport = query => { - return request({ - url: '/admin/promiseStarUserRecord/export', - method: 'get', - data: query - }); + window.location.href = `/admin/promiseStarUserRecord/export?${genQueryParam(query)}` + return; }; diff --git a/src/utils/system-helper.js b/src/utils/system-helper.js index 2004767..335aa36 100644 --- a/src/utils/system-helper.js +++ b/src/utils/system-helper.js @@ -35,4 +35,13 @@ export function dateFormat (date, fmt) { date = o = padLeftZero = null; return fmt; +} + +export function genQueryParam(json) { + if (!json) return '' + return cleanArray(Object.keys(json).map(key => { + if (json[key] === undefined) return '' + return encodeURIComponent(key) + '=' + + encodeURIComponent(json[key]) + })).join('&'); } \ No newline at end of file