mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix url generation with domainId
This commit is contained in:
1 parent
116415707b
commit
6c274497b4
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.12.2",
|
"version": "3.12.3",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default (router, logger) => async (ctx: KoaContext, next) => {
|
|||||||
|| (host instanceof Array
|
|| (host instanceof Array
|
||||||
? (!host.includes(request.host))
|
? (!host.includes(request.host))
|
||||||
: request.host !== host)
|
: request.host !== host)
|
||||||
)) withDomainId = domainId;
|
)) withDomainId ||= domainId;
|
||||||
res = router.url(name, args, { query }).toString();
|
res = router.url(name, args, { query }).toString();
|
||||||
if (anchor) res = `${res}#${anchor}`;
|
if (anchor) res = `${res}#${anchor}`;
|
||||||
if (withDomainId) res = `/d/${withDomainId}${res}`;
|
if (withDomainId) res = `/d/${withDomainId}${res}`;
|
||||||
|
|||||||
Reference in new issue
Block a user