fix(route): dlsite campaign (#6987)

This commit is contained in:
hoilc
2021-02-23 07:58:00 +08:00
committed by GitHub
parent 57aa44bf71
commit ba3b66c46d

View File

@@ -104,18 +104,18 @@ const infos = {
}, },
}; };
const setUrl = (info) => { const setUrl = (info) => {
let paramsPath = `${info.url}/=`; let paramsPath = `${info.url}/=/`;
const params = info.params; const params = info.params;
for (const name in params) { for (const name in params) {
if (Array.isArray(params[name])) { if (Array.isArray(params[name])) {
for (const index in params[name]) { for (const index in params[name]) {
paramsPath += `${name}[${index}]/${params[name][index]}`; paramsPath += `${name}[${index}]/${params[name][index]}/`;
} }
} else { } else {
paramsPath += `${name}/${params[name]}`; paramsPath += `${name}/${params[name]}/`;
} }
} }
return paramsPath; return paramsPath.slice(1);
}; };
module.exports = async (ctx) => { module.exports = async (ctx) => {
@@ -167,7 +167,7 @@ module.exports = async (ctx) => {
ctx.state.data = { ctx.state.data = {
title: title, title: title,
link: link, link: `${host}/${link}`,
description: description, description: description,
language: 'ja-jp', language: 'ja-jp',
allowEmpty: true, allowEmpty: true,