itizawa 5 lat temu
rodzic
commit
b8ac0c0192
2 zmienionych plików z 3 dodań i 3 usunięć
  1. 1 1
      src/server/routes/index.js
  2. 2 2
      src/server/routes/page.js

+ 1 - 1
src/server/routes/index.js

@@ -180,7 +180,7 @@ module.exports = function(crowi, app) {
   app.post('/_api/hackmd.discard'        , accessTokenParser , loginRequiredStrictly , csrf, hackmd.validateForApi, hackmd.discard);
   app.post('/_api/hackmd.saveOnHackmd'   , accessTokenParser , loginRequiredStrictly , csrf, hackmd.validateForApi, hackmd.saveOnHackmd);
 
-  app.get('/share/:link', page.showSharePage, page.notFound);
+  app.get('/share/:linkId', page.showSharePage, page.notFound);
 
   app.get('/*/$'                   , loginRequired , page.showPageWithEndOfSlash, page.notFound);
   app.get('/*'                     , loginRequired , page.showPage, page.notFound);

+ 2 - 2
src/server/routes/page.js

@@ -441,12 +441,12 @@ module.exports = function(crowi, app) {
   };
 
   actions.showSharePage = async function(req, res, next) {
-    const { link } = req.params;
+    const { linkId } = req.params;
 
     const layoutName = configManager.getConfig('crowi', 'customize:layout');
     let view = `layout-${layoutName}/page`;
 
-    const shareLink = await ShareLink.find({ _id: link }).populate('Page');
+    const shareLink = await ShareLink.find({ _id: linkId }).populate('Page');
     const page = shareLink.relatedPage;
 
     if (page == null) {