fix: 1. 接入入口模块的管理接口,优化样式。
2. 将查看文档评查结果详情对接接口,采用接口的方式进行查询。
This commit is contained in:
@@ -16,11 +16,11 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
const filePath = url.searchParams.get("path");
|
||||
const isPreview = url.searchParams.get("preview") === "true";
|
||||
|
||||
console.log("📄 [PDF Proxy] 请求参数:", {
|
||||
path: filePath,
|
||||
preview: url.searchParams.get("preview"),
|
||||
isPreview: isPreview
|
||||
});
|
||||
// console.log("📄 [PDF Proxy] 请求参数:", {
|
||||
// path: filePath,
|
||||
// preview: url.searchParams.get("preview"),
|
||||
// isPreview: isPreview
|
||||
// });
|
||||
|
||||
if (!filePath) {
|
||||
return new Response("缺少文件路径参数", { status: 400 });
|
||||
@@ -70,14 +70,14 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
if (isPreview) {
|
||||
// 在浏览器中预览
|
||||
headers['Content-Disposition'] = `inline; filename="${encodeURIComponent(fileName)}"`;
|
||||
console.log("📄 [PDF Proxy] 设置为预览模式 (inline)");
|
||||
// console.log("📄 [PDF Proxy] 设置为预览模式 (inline)");
|
||||
} else {
|
||||
// 强制下载(默认行为)
|
||||
headers['Content-Disposition'] = `attachment; filename="${encodeURIComponent(fileName)}"`;
|
||||
console.log("📄 [PDF Proxy] 设置为下载模式 (attachment)");
|
||||
// console.log("📄 [PDF Proxy] 设置为下载模式 (attachment)");
|
||||
}
|
||||
|
||||
console.log("📄 [PDF Proxy] 响应头:", headers);
|
||||
// console.log("📄 [PDF Proxy] 响应头:", headers);
|
||||
|
||||
// 返回文件
|
||||
return new Response(blob, { headers });
|
||||
|
||||
Reference in New Issue
Block a user