Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m21s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m21s
* develop: fix test fix download manual
This commit is contained in:
commit
62c7afb528
2 changed files with 15 additions and 11 deletions
|
|
@ -18,12 +18,14 @@ http {
|
|||
listen 80;
|
||||
server_name localhost;
|
||||
location / {
|
||||
return 301 /manual/;
|
||||
}
|
||||
location /manual/ {
|
||||
alias /app/;
|
||||
root /app;
|
||||
# return 301 /manual/;
|
||||
# }
|
||||
# location /manual/ {
|
||||
# alias /app/;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /manual/index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
# try_files $uri $uri/ /manual/index.html;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
|
|
|
|||
|
|
@ -81,12 +81,13 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const downloadManual = () => {
|
||||
const fileName = route.fullPath.split("/").pop();
|
||||
const origin = window.location.origin;
|
||||
const pathname = window.location.pathname;
|
||||
const fileName = route.fullPath.split("/").pop(); // example: chapter-1-1
|
||||
const origin = window.location.origin; // example: http://localhost:8080
|
||||
const pathname = window.location.pathname; // example: /manual/chapter-1-1
|
||||
const url = ref<string>("");
|
||||
if (pathname.includes("manual")) {
|
||||
const pdfUrl = origin + pathname.replace("manual", "documents") + ".pdf";
|
||||
// const pdfUrl = origin + pathname.replace("manual", "documents") + ".pdf";
|
||||
const pdfUrl = origin + "/manual/documents/" + fileName + ".pdf";
|
||||
url.value = pdfUrl;
|
||||
} else {
|
||||
const pdfUrl = origin + "/documents" + pathname + ".pdf";
|
||||
|
|
@ -101,9 +102,10 @@ const downloadManual = () => {
|
|||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
const downloadManualAll = (title:string) => {
|
||||
const downloadManualAll = (title: string) => {
|
||||
const fileName = `manual-${title}.pdf`;
|
||||
const pdfUrl = window.location.origin + `/documents/manual-${title}.pdf`;
|
||||
const pdfUrl =
|
||||
window.location.origin + `/manual/documents/manual-${title}.pdf`;
|
||||
const link = document.createElement("a");
|
||||
link.href = pdfUrl;
|
||||
link.download = `${fileName}`; // ชื่อไฟล์ที่ต้องการดาวน์โหลด
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue