Skip to content

Commit

Permalink
refactor: remove copilot instructions and enhance URL handling in get…
Browse files Browse the repository at this point in the history
…Href function
  • Loading branch information
coderfe committed Feb 20, 2025
1 parent 2e8613a commit 1f80d0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .github/copilot-instructions.md

This file was deleted.

5 changes: 4 additions & 1 deletion src/lib/helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
export const getHref = () => {
if (typeof window === 'undefined') return '';
return window.location.href.replace('http://dev.', 'https://').replace(/\/$/, '');
const url = new URL(window.location.href);
// 处理更多开发环境的情况
const hostname = url.hostname.replace(/^(dev\.|local\.)/, '');
return `https://${hostname}${url.pathname}`.replace(/\/$/, '');
};

export function throttle(func: Function, timeFrame: number) {
Expand Down

0 comments on commit 1f80d0f

Please sign in to comment.