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