feat: proxy和redirect拦截器,支持命名捕获组名称来设置占位符
							parent
							
								
									0edee7b6eb
								
							
						
					
					
						commit
						d2a4a2028b
					
				| 
						 | 
				
			
			@ -11,6 +11,11 @@ function replacePlaceholder (url, rOptions, matched) {
 | 
			
		|||
      for (let i = 0; i < matched.length; i++) {
 | 
			
		||||
        url = url.replace(`\${m[${i}]}`, matched[i] == null ? '' : matched[i])
 | 
			
		||||
      }
 | 
			
		||||
      if (matched.groups) {
 | 
			
		||||
        for (const key in matched.groups) {
 | 
			
		||||
          url = url.replace(`\${${key}}`, matched.groups[key] == null ? '' : matched.groups[key])
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 移除多余的占位符
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue