Skip to content

Commit

Permalink
fix: missed sub path on copy preview url (close alist-org/alist#4624)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 26, 2023
1 parent d1a46c4 commit a127ddb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getLinkByDirAndObj = (
let host = api
let prefix = type === "direct" ? "/d" : "/p"
if (type === "preview") {
host = location.origin
if (!api.startsWith(location.origin)) host = location.origin
prefix = ""
}
let ans = `${host}${prefix}${path}`
Expand Down

0 comments on commit a127ddb

Please sign in to comment.