Skip to content

Commit

Permalink
fix: share url 生成逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Nov 28, 2024
1 parent 94500df commit dd7155b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.304",
"version": "2.14.305",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
5 changes: 1 addition & 4 deletions src/views/share/Share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,7 @@ const secretPath = computed(() => {
const handleShareDetail = (detail: Share) => {
console.log('detail', detail)
const { type, name, token } = detail;
const shareUrl = `${host.value.replace(
new RegExp(`${secretPath.value}`),
"/share",
)}/${type}/${encodeURIComponent(name)}?token=${token}`;
const shareUrl = `${host.value.replace(new RegExp(`${secretPath.value}$`), "")}/share/${type}/${encodeURIComponent(name)}?token=${token}`;
shareData.value = { ...detail, shareUrl };
shareDataType.value = type;
sharePopupVisible.value = true;
Expand Down
5 changes: 1 addition & 4 deletions src/views/share/SharePopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,7 @@ const handleCreateShare = async () => {
if (res?.data?.status === "success") {
isCreateShareLinkSuccess.value = true;
const { token } = res.data.data;
const shareUrl = `${host.value.replace(
new RegExp(`${secretPath.value}$`),
"/share",
)}/${typeMap[form.type]}/${encodeURIComponent(
const shareUrl = `${host.value.replace(new RegExp(`${secretPath.value}$`), "")}/share/${typeMap[form.type]}/${encodeURIComponent(
props.data.name,
)}?token=${encodeURIComponent(token)}`;
form.shareUrl = shareUrl;
Expand Down

0 comments on commit dd7155b

Please sign in to comment.