Skip to content

Commit 834fa7e

Browse files
committed
fix(axios): make sure that the parameter is an object before processing, fix #660
1 parent 5662804 commit 834fa7e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/http/axios/helper.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export function createNow(join: boolean, restful = false): string | object {
2121
/**
2222
* @description: Format request parameter time
2323
*/
24-
export function formatRequestDate(params: any) {
24+
export function formatRequestDate(params: Recordable) {
25+
if (Object.prototype.toString.call(params) !== '[object Object]') {
26+
return;
27+
}
28+
2529
for (const key in params) {
2630
if (params[key] && params[key]._isAMomentObject) {
2731
params[key] = params[key].format(DATE_TIME_FORMAT);

0 commit comments

Comments
 (0)