fix
This commit is contained in:
parent
60eaac4e84
commit
b7f31ebd24
|
|
@ -19,7 +19,7 @@ export const _ = {
|
||||||
const origin = req.headers.get("origin");
|
const origin = req.headers.get("origin");
|
||||||
if (origin) {
|
if (origin) {
|
||||||
const url = new URL(origin);
|
const url = new URL(origin);
|
||||||
if (url.hostname === "localhost") {
|
if (url.port === "4550") {
|
||||||
setDefaultCookie = false;
|
setDefaultCookie = false;
|
||||||
res.setHeader("set-cookie", `${session.cookieKey}=${sdata.id};`);
|
res.setHeader("set-cookie", `${session.cookieKey}=${sdata.id};`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -11,6 +11,7 @@ const schema_promise = {
|
||||||
|
|
||||||
export const dbProxy = (dburl: string) => {
|
export const dbProxy = (dburl: string) => {
|
||||||
const name = "";
|
const name = "";
|
||||||
|
|
||||||
return new Proxy(
|
return new Proxy(
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
|
|
@ -165,7 +166,9 @@ export const fetchSendDb = async (
|
||||||
typeof location !== "undefined" &&
|
typeof location !== "undefined" &&
|
||||||
base.hostname !== location.hostname &&
|
base.hostname !== location.hostname &&
|
||||||
(window as any).isEditor &&
|
(window as any).isEditor &&
|
||||||
["prasi.avolut.com", "localhost:4550"].includes(location.host)
|
["prasi.avolut.com", "localhost:4550", "127.0.0.1:4550"].includes(
|
||||||
|
location.host
|
||||||
|
)
|
||||||
)
|
)
|
||||||
isEditor = true;
|
isEditor = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ const getRoute = () => {
|
||||||
fetch(base.url`_prasi/compress/only-gz`);
|
fetch(base.url`_prasi/compress/only-gz`);
|
||||||
}
|
}
|
||||||
cached.route = await res.json();
|
cached.route = await res.json();
|
||||||
|
|
||||||
done(cached.route);
|
done(cached.route);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -49,6 +50,7 @@ export const initBaseRoute = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
base.site = res.site;
|
base.site = res.site;
|
||||||
|
|
||||||
base.site.code = { mode: "vsc" };
|
base.site.code = { mode: "vsc" };
|
||||||
await injectSiteScript();
|
await injectSiteScript();
|
||||||
|
|
||||||
|
|
@ -78,6 +80,7 @@ const injectSiteScript = () => {
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
let base_url = base.site.api_url;
|
let base_url = base.site.api_url;
|
||||||
|
|
||||||
if (base_url === "*") {
|
if (base_url === "*") {
|
||||||
base_url = `${location.protocol}//${location.host}`;
|
base_url = `${location.protocol}//${location.host}`;
|
||||||
base.site.api_url = base_url;
|
base.site.api_url = base_url;
|
||||||
|
|
@ -92,8 +95,7 @@ const injectSiteScript = () => {
|
||||||
cur.pathname = "";
|
cur.pathname = "";
|
||||||
if (
|
if (
|
||||||
!base_url ||
|
!base_url ||
|
||||||
(!["prasi.avolut.com"].includes(cur.hostname) &&
|
(!["prasi.avolut.com"].includes(cur.hostname) && cur.port !== "4550")
|
||||||
cur.host !== "localhost:4550")
|
|
||||||
) {
|
) {
|
||||||
cur.hash = "";
|
cur.hash = "";
|
||||||
let cur_url = trim(cur.toString(), "/");
|
let cur_url = trim(cur.toString(), "/");
|
||||||
|
|
@ -125,7 +127,7 @@ export const rebuildMeta = (meta: Record<string, IMeta>, root: IRoot) => {
|
||||||
meta,
|
meta,
|
||||||
mode: "page",
|
mode: "page",
|
||||||
},
|
},
|
||||||
{ item },
|
{ item }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,12 @@ export const Root = () => {
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
let mobileCSS = "";
|
let mobileCSS = "";
|
||||||
|
console.log(
|
||||||
|
base.mode,
|
||||||
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
||||||
|
navigator.userAgent
|
||||||
|
)
|
||||||
|
);
|
||||||
if (base.mode === "mobile") {
|
if (base.mode === "mobile") {
|
||||||
if (
|
if (
|
||||||
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ export const Vi: FC<{
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
["prasi.avolut.com"].includes(location.hostname) ||
|
["prasi.avolut.com"].includes(location.hostname) ||
|
||||||
location.host === "localhost:4550"
|
location.port === "4550"
|
||||||
) {
|
) {
|
||||||
if (vi.site.api_url) {
|
if (vi.site.api_url) {
|
||||||
if (!vi.site_url) {
|
if (!vi.site_url) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue