Skip to content

Commit

Permalink
fix: isHomepage match
Browse files Browse the repository at this point in the history
  • Loading branch information
loo-y committed Nov 4, 2023
1 parent 1e1b9fa commit ef96a3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/scripts/reactVirtual/modules/FloatingPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ const FloatingPopup: React.FC = () => {
}

const handleSaveWeibo = () => {
const currentUrl = document.location.href || ``
const theUid = currentUrl?.match(/u\/(\d+)/)?.[1] || ``
const currentUrl = new URL(document.location.href)
const urlPath = currentUrl.pathname || window.location.pathname
const theUid = urlPath?.match(/u\/(\d+)/)?.[1] || urlPath?.match(/^\/(\d+)/)?.[1] || ``
dispatch(updateShowFloatingPopup(false))
if (!theUid) {
setTimeout(() => alert(`请先访问个人主页,再进行备份!`), 50)
Expand Down

0 comments on commit ef96a3d

Please sign in to comment.