修复查询参数

This commit is contained in:
liaozetao
2024-02-27 18:21:31 +08:00
committed by Dragon
parent b900c5fe83
commit 5d13b68c5a
3 changed files with 11 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
import qs from 'qs'; import qs from 'qs';
import { genQueryParam } from '@/utils/system-helper'; import { genQueryParam } from '@/utils/maintainer';
// ==================================许愿礼物配置==================================== // ==================================许愿礼物配置====================================
// 表单 // 表单
@@ -71,6 +71,6 @@ export const promiseStarUserRecordPage = query => {
}); });
}; };
export const promiseStarUserRecordExport = query => { export const promiseStarUserRecordExport = query => {
window.location.href = `/admin/promiseStarUserRecord/export?${genQueryParam(query)}` window.location.href = `/admin/promiseStarUserRecord/export?${genQueryParam(query)}`;
return; return;
}; };

View File

@@ -48,3 +48,12 @@ export function apiResult(json) {
$("#tipModal").modal('show'); $("#tipModal").modal('show');
return false; return false;
} }
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('&');
}

View File

@@ -36,12 +36,3 @@ export function dateFormat (date, fmt) {
date = o = padLeftZero = null; date = o = padLeftZero = null;
return fmt; 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('&');
}