Pārlūkot izejas kodu

window.open(fullUrl, "_blank");

visuddhinanda 2 gadi atpakaļ
vecāks
revīzija
a176aed553

+ 5 - 1
dashboard/src/components/anthology/AnthologyList.tsx

@@ -255,7 +255,11 @@ const AnthologyListWidget = ({
                   onClick: (e) => {
                   onClick: (e) => {
                     switch (e.key) {
                     switch (e.key) {
                       case "open":
                       case "open":
-                        window.open(`/anthology/${row.id}`, "_blank");
+                        const fullUrl =
+                          process.env.REACT_APP_WEB_HOST +
+                          process.env.PUBLIC_URL +
+                          `/anthology/${row.id}`;
+                        window.open(fullUrl, "_blank");
                         break;
                         break;
                       case "share":
                       case "share":
                         console.log("share");
                         console.log("share");

+ 5 - 0
dashboard/src/components/anthology/EditableTocTree.tsx

@@ -149,6 +149,11 @@ const EditableTocTreeWidget = ({
           node: TreeNodeData
           node: TreeNodeData
         ) => {
         ) => {
           if (e.ctrlKey || e.metaKey) {
           if (e.ctrlKey || e.metaKey) {
+            const fullUrl =
+              process.env.REACT_APP_WEB_HOST +
+              process.env.PUBLIC_URL +
+              `/article/article/${node.key}`;
+            window.open(fullUrl, "_blank");
           } else {
           } else {
             setViewArticleId(node.key);
             setViewArticleId(node.key);
             setOpenViewer(true);
             setOpenViewer(true);

+ 5 - 1
dashboard/src/pages/library/article/show.tsx

@@ -298,7 +298,11 @@ const Widget = () => {
                   }
                   }
                 });
                 });
                 if (event.ctrlKey || event.metaKey) {
                 if (event.ctrlKey || event.metaKey) {
-                  window.open(url, "_blank");
+                  const fullUrl =
+                    process.env.REACT_APP_WEB_HOST +
+                    process.env.PUBLIC_URL +
+                    url;
+                  window.open(fullUrl, "_blank");
                 } else {
                 } else {
                   navigate(url);
                   navigate(url);
                 }
                 }