Skip to content

Commit

Permalink
fix(axios): make sure that the parameter is an object before processi…
Browse files Browse the repository at this point in the history
…ng, fix #660
  • Loading branch information
anncwb committed May 27, 2021
1 parent 5662804 commit 834fa7e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/http/axios/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export function createNow(join: boolean, restful = false): string | object {
/**
* @description: Format request parameter time
*/
export function formatRequestDate(params: any) {
export function formatRequestDate(params: Recordable) {
if (Object.prototype.toString.call(params) !== '[object Object]') {
return;
}

for (const key in params) {
if (params[key] && params[key]._isAMomentObject) {
params[key] = params[key].format(DATE_TIME_FORMAT);
Expand Down

0 comments on commit 834fa7e

Please sign in to comment.