mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +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",
|
||||
"version": "3.12.2",
|
||||
"version": "3.12.3",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -52,7 +52,7 @@ export default (router, logger) => async (ctx: KoaContext, next) => {
|
||||
|| (host instanceof Array
|
||||
? (!host.includes(request.host))
|
||||
: request.host !== host)
|
||||
)) withDomainId = domainId;
|
||||
)) withDomainId ||= domainId;
|
||||
res = router.url(name, args, { query }).toString();
|
||||
if (anchor) res = `${res}#${anchor}`;
|
||||
if (withDomainId) res = `/d/${withDomainId}${res}`;
|
||||
|
||||
Reference in new issue
Block a user