added url hash
This commit is contained in:
parent
75ad746578
commit
650a476106
1 changed files with 3 additions and 3 deletions
|
@ -24,11 +24,11 @@ let portal = ref(PortalABase);
|
||||||
function ItoN() {
|
function ItoN() {
|
||||||
try {
|
try {
|
||||||
const in_url = new URL(ItoN_in.value);
|
const in_url = new URL(ItoN_in.value);
|
||||||
const re = RegExp("(?=DanaInfo=).*(?=,SSL\+)")
|
const re = RegExp("(?=DanaInfo=).*(?=,SSL\\+)")
|
||||||
const hostname = in_url.pathname.match(re)[0].replace("DanaInfo=", "")
|
const hostname = in_url.pathname.match(re)[0].replace("DanaInfo=", "")
|
||||||
const re2 = RegExp("(,DanaInfo=)(.*,SSL\\+)")
|
const re2 = RegExp("(,DanaInfo=)(.*,SSL\\+)")
|
||||||
const pathname = in_url.pathname.replace(re2, "")
|
const pathname = in_url.pathname.replace(re2, "")
|
||||||
let out_url = "https://" + hostname + pathname + in_url.search;
|
let out_url = "https://" + hostname + pathname + in_url.search + in_url.hash;
|
||||||
ItoN_out.value = out_url;
|
ItoN_out.value = out_url;
|
||||||
ItoN_error.value = false;
|
ItoN_error.value = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -62,7 +62,7 @@ function NtoI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let out_url = in_url.pathname.split('/').slice(1,-1).join("/") + "/,DanaInfo=" + in_url.hostname + ",SSL+" + in_url.pathname.split('/').slice(-1)[0] + in_url.search;
|
let out_url = in_url.pathname.split('/').slice(1,-1).join("/") + "/,DanaInfo=" + in_url.hostname + ",SSL+" + in_url.pathname.split('/').slice(-1)[0] + in_url.search + in_url.hash;
|
||||||
out_url = out_url.replace(/^(\/)/g, '');
|
out_url = out_url.replace(/^(\/)/g, '');
|
||||||
NtoI_out_a.value = PortalABase + out_url;
|
NtoI_out_a.value = PortalABase + out_url;
|
||||||
NtoI_out_b.value = PortalBBase + out_url;
|
NtoI_out_b.value = PortalBBase + out_url;
|
||||||
|
|
Loading…
Reference in a new issue