소스 검색

fix(router): 修复当myQuery为空对象时仍添加查询参数的问题

feige996 7 달 전
부모
커밋
ca283f0619
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/router/interceptor.ts

+ 1 - 1
src/router/interceptor.ts

@@ -73,7 +73,7 @@ export const navigateToInterceptor = {
     }
     let fullPath = path
 
-    if (myQuery) {
+    if (Object.keys(myQuery).length) {
       fullPath += `?${Object.keys(myQuery).map(key => `${key}=${myQuery[key]}`).join('&')}`
     }
     const redirectUrl = `${LOGIN_PAGE}?redirect=${encodeURIComponent(fullPath)}`