fix: use deployment-relative material URLs

main
陈沅 4 days ago
parent b4dd453afb
commit 2e28718646

@ -0,0 +1,9 @@
-- Case material links must be deployment-relative. A persisted localhost URL
-- makes a student's browser download from its own computer instead of this server.
UPDATE training_task
SET material_url = REGEXP_REPLACE(material_url, '^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?', '')
WHERE material_url REGEXP '^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?/file/';
UPDATE training_task_class_config
SET material_url = REGEXP_REPLACE(material_url, '^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?', '')
WHERE material_url REGEXP '^https?://(localhost|127\\.0\\.0\\.1)(:[0-9]+)?/file/';

@ -12,7 +12,9 @@ spring:
file: file:
type: local type: local
path: file path: file
url: ${FILE_URL:http://localhost:7548/file} # Keep public file URLs deployment-relative by default. Absolute localhost URLs
# point to each student's own computer and cannot be used by other clients.
url: ${FILE_URL:/file}
#path: D:/tianzeProject/linkCommerce/ #path: D:/tianzeProject/linkCommerce/
#url: "http://192.168.2.8:147/file" #url: "http://192.168.2.8:147/file"
@ -27,4 +29,3 @@ item:

Loading…
Cancel
Save