|
@@ -104,7 +104,7 @@ router.get("/:record_id", async function (req, res) {
|
|
|
const files = await getFileByRecordId(record_id);
|
|
|
// 获取请求的来源域名
|
|
|
// const host = req.headers['host']; // 主机名 + 端口
|
|
|
- const origin = req.headers["origin"]; // 请求的来源域(适用于跨域)
|
|
|
+ const origin = req.headers["host"]; // 请求的来源域(适用于跨域)
|
|
|
|
|
|
const typesRes = await getTypesById({
|
|
|
typeId: recordInfo.type_id,
|
|
@@ -127,7 +127,7 @@ router.get("/:record_id", async function (req, res) {
|
|
|
files: files.map(
|
|
|
(elm) =>
|
|
|
`${
|
|
|
- origin.indexOf("3032") > -1 ? "http://localhost:3000" : origin
|
|
|
+ `${origin}`.indexOf("3032") > -1 ? "http://localhost:3000" : origin
|
|
|
}/api/v1/files/${elm.file_id}`
|
|
|
),
|
|
|
},
|