Browse Source

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

feige996 7 months ago
parent
commit
ca283f0619
1 changed files with 1 additions and 1 deletions
  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)}`