Ver código fonte

下载链接修改

yuwenjun1997 2 anos atrás
pai
commit
1a9f45e26e
2 arquivos alterados com 3 adições e 3 exclusões
  1. 2 2
      middleware/intercept.js
  2. 1 1
      utils/donwload-tools.js

+ 2 - 2
middleware/intercept.js

@@ -52,7 +52,7 @@ async function initTemplateEntry(context) {
   const { route, $http, error, store, redirect } = context
   try {
     // 模板不存在
-    let authUserId = route.params.template
+    let authUserId = parseInt(route.params.template)
     if (!authUserId) {
       showError(error, { statusCode: 500, message: '页面不存在' })
       return
@@ -99,7 +99,7 @@ async function initTemplateEntry(context) {
 
 export default function (context) {
   const name = context.route.name
-  console.log(name)
+  // console.log(name)
   if (isPublicEntry(name)) return // initPublicEntry(context)
   if (isTemplateEntry(name)) return initTemplateEntry(context)
   context.error({ statusCode: 404, message: '页面不存在' })

+ 1 - 1
utils/donwload-tools.js

@@ -91,7 +91,7 @@ export default function downloadFile(downUrl, fileName, self, $event) {
     }
     const redirectUrl = `${
       process.env.LOCALHOSE
-    }/download?state=${encodeURIComponent(encrypt(data))}`
+    }/public/download?state=${encodeURIComponent(encrypt(data))}`
     return handleClipboard(
       redirectUrl,
       $event,