- 修改 app/components/oa/TaskForm.vue 中 a-input 类型冲突为 a-input-number - 合并 admin/supply/warehouse.vue 和 production/equipment.vue 中多个 :class 绑定,避免重复属性 - 统一改为数组方式绑定静态和动态 class,防止 Vue 编译器 Duplicate attribute 警告 - 清理缓存并验证构建通过,确保无重复属性错误 - 通过扫描确认 app/ 目录下 Vue 文件不再存在重复属性问题 - 添加 OaTaskForm 组件类型声明及懒加载声明 - 将 ERP 演示独立 HTML 页面整合至 /app/pages,统一布局与导航 - 升级制造业管理后台页面风格,采用玻璃态和渐变设计 - 修订规划文档相关内容,更新 DEMO 系统名称及功能模块描述 - 修改 ecosystem.config.cjs 中运行端口为 10591
4287 lines
156 KiB
JavaScript
4287 lines
156 KiB
JavaScript
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import { tmpdir } from 'node:os';
|
|
import { defineEventHandler, handleCacheHeaders, splitCookiesString, createEvent, fetchWithEvent, isEvent, eventHandler, setHeaders, sendRedirect, proxyRequest, getRequestHeader, setResponseHeaders, setResponseStatus, send, getRequestHeaders, setResponseHeader, appendResponseHeader, getRequestURL, getResponseHeader, getResponseStatus, createError, getCookie, setCookie, sanitizeStatusCode, removeResponseHeader, getQuery as getQuery$1, readBody, getRouterParam, setHeader, createApp, createRouter as createRouter$1, toNodeListener, lazyEventHandler, getHeader, getResponseStatusText } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/h3@1.15.4/node_modules/h3/dist/index.mjs';
|
|
import { Server } from 'node:http';
|
|
import { resolve, dirname, join } from 'node:path';
|
|
import nodeCrypto from 'node:crypto';
|
|
import { parentPort, threadId } from 'node:worker_threads';
|
|
import { escapeHtml } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/@vue+shared@3.5.26/node_modules/@vue/shared/dist/shared.cjs.js';
|
|
import { createFetch, Headers as Headers$1, $fetch as $fetch$1 } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs';
|
|
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/vue-bundle-renderer@2.2.0/node_modules/vue-bundle-renderer/dist/runtime.mjs';
|
|
import { parseURL, withoutBase, joinURL as joinURL$5, getQuery, withQuery, joinRelativeURL, parsePath, withoutTrailingSlash, withLeadingSlash, withTrailingSlash, decodePath } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs';
|
|
import destr, { destr as destr$1 } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs';
|
|
import { createHooks } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs';
|
|
import { fetchNodeRequestHandler, callNodeRequestHandler } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs';
|
|
import { createStorage, prefixStorage } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/unstorage@1.17.3_db0@0.3.4_better-sqlite3@12.8.0__ioredis@5.8.2/node_modules/unstorage/dist/index.mjs';
|
|
import unstorage_47drivers_47fs from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/unstorage@1.17.3_db0@0.3.4_better-sqlite3@12.8.0__ioredis@5.8.2/node_modules/unstorage/drivers/fs.mjs';
|
|
import { digest } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs';
|
|
import { klona } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs';
|
|
import defu, { defuFn, createDefu } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs';
|
|
import { snakeCase } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs';
|
|
import { getContext } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs';
|
|
import { toRouteMatcher, createRouter } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs';
|
|
import { readFile } from 'node:fs/promises';
|
|
import consola, { consola as consola$1 } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs';
|
|
import { ErrorParser } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/youch-core@0.3.3/node_modules/youch-core/build/index.js';
|
|
import { Youch } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/youch@4.1.0-beta.13/node_modules/youch/build/index.js';
|
|
import { SourceMapConsumer } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/source-map@0.7.6/node_modules/source-map/source-map.js';
|
|
import { createRouterMatcher } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/vue-router@5.0.4_@vue+compiler-sfc@3.5.26_vue@3.5.26_typescript@5.9.3_/node_modules/vue-router/vue-router.node.mjs';
|
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
import { stringify, uneval } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/devalue@5.6.1/node_modules/devalue/index.js';
|
|
import { captureRawStackTrace, parseRawStackTrace } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/errx@0.1.0/node_modules/errx/dist/index.js';
|
|
import { isVNode, toValue, isRef } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/vue@3.5.26_typescript@5.9.3/node_modules/vue/index.mjs';
|
|
import { promises } from 'node:fs';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { dirname as dirname$1, resolve as resolve$1, isAbsolute } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs';
|
|
import { createHead as createHead$1, propsToString, renderSSRHead } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/unhead@2.1.1/node_modules/unhead/dist/server.mjs';
|
|
import process$1 from 'node:process';
|
|
import { renderToString } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/vue@3.5.26_typescript@5.9.3/node_modules/vue/server-renderer/index.mjs';
|
|
import { walkResolver } from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/unhead@2.1.1/node_modules/unhead/dist/utils.mjs';
|
|
import localAdapter from 'file:///Users/gxwebsoft/VUE/tiantian-system/node_modules/.pnpm/db0@0.3.4_better-sqlite3@12.8.0/node_modules/db0/dist/connectors/better-sqlite3.mjs';
|
|
|
|
const serverAssets = [{"baseName":"server","dir":"/Users/gxwebsoft/VUE/tiantian-system/server/assets"}];
|
|
|
|
const assets$1 = createStorage();
|
|
|
|
for (const asset of serverAssets) {
|
|
assets$1.mount(asset.baseName, unstorage_47drivers_47fs({ base: asset.dir, ignore: (asset?.ignore || []) }));
|
|
}
|
|
|
|
const storage$1 = createStorage({});
|
|
|
|
storage$1.mount('/assets', assets$1);
|
|
|
|
storage$1.mount('root', unstorage_47drivers_47fs({"driver":"fs","readOnly":true,"base":"/Users/gxwebsoft/VUE/tiantian-system","watchOptions":{"ignored":[null]}}));
|
|
storage$1.mount('src', unstorage_47drivers_47fs({"driver":"fs","readOnly":true,"base":"/Users/gxwebsoft/VUE/tiantian-system/server","watchOptions":{"ignored":[null]}}));
|
|
storage$1.mount('build', unstorage_47drivers_47fs({"driver":"fs","readOnly":false,"base":"/Users/gxwebsoft/VUE/tiantian-system/.nuxt"}));
|
|
storage$1.mount('cache', unstorage_47drivers_47fs({"driver":"fs","readOnly":false,"base":"/Users/gxwebsoft/VUE/tiantian-system/.nuxt/cache"}));
|
|
storage$1.mount('data', unstorage_47drivers_47fs({"driver":"fs","base":"/Users/gxwebsoft/VUE/tiantian-system/.data/kv"}));
|
|
|
|
function useStorage(base = "") {
|
|
return base ? prefixStorage(storage$1, base) : storage$1;
|
|
}
|
|
|
|
const Hasher = /* @__PURE__ */ (() => {
|
|
class Hasher2 {
|
|
buff = "";
|
|
#context = /* @__PURE__ */ new Map();
|
|
write(str) {
|
|
this.buff += str;
|
|
}
|
|
dispatch(value) {
|
|
const type = value === null ? "null" : typeof value;
|
|
return this[type](value);
|
|
}
|
|
object(object) {
|
|
if (object && typeof object.toJSON === "function") {
|
|
return this.object(object.toJSON());
|
|
}
|
|
const objString = Object.prototype.toString.call(object);
|
|
let objType = "";
|
|
const objectLength = objString.length;
|
|
objType = objectLength < 10 ? "unknown:[" + objString + "]" : objString.slice(8, objectLength - 1);
|
|
objType = objType.toLowerCase();
|
|
let objectNumber = null;
|
|
if ((objectNumber = this.#context.get(object)) === void 0) {
|
|
this.#context.set(object, this.#context.size);
|
|
} else {
|
|
return this.dispatch("[CIRCULAR:" + objectNumber + "]");
|
|
}
|
|
if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
|
|
this.write("buffer:");
|
|
return this.write(object.toString("utf8"));
|
|
}
|
|
if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
|
|
if (this[objType]) {
|
|
this[objType](object);
|
|
} else {
|
|
this.unknown(object, objType);
|
|
}
|
|
} else {
|
|
const keys = Object.keys(object).sort();
|
|
const extraKeys = [];
|
|
this.write("object:" + (keys.length + extraKeys.length) + ":");
|
|
const dispatchForKey = (key) => {
|
|
this.dispatch(key);
|
|
this.write(":");
|
|
this.dispatch(object[key]);
|
|
this.write(",");
|
|
};
|
|
for (const key of keys) {
|
|
dispatchForKey(key);
|
|
}
|
|
for (const key of extraKeys) {
|
|
dispatchForKey(key);
|
|
}
|
|
}
|
|
}
|
|
array(arr, unordered) {
|
|
unordered = unordered === void 0 ? false : unordered;
|
|
this.write("array:" + arr.length + ":");
|
|
if (!unordered || arr.length <= 1) {
|
|
for (const entry of arr) {
|
|
this.dispatch(entry);
|
|
}
|
|
return;
|
|
}
|
|
const contextAdditions = /* @__PURE__ */ new Map();
|
|
const entries = arr.map((entry) => {
|
|
const hasher = new Hasher2();
|
|
hasher.dispatch(entry);
|
|
for (const [key, value] of hasher.#context) {
|
|
contextAdditions.set(key, value);
|
|
}
|
|
return hasher.toString();
|
|
});
|
|
this.#context = contextAdditions;
|
|
entries.sort();
|
|
return this.array(entries, false);
|
|
}
|
|
date(date) {
|
|
return this.write("date:" + date.toJSON());
|
|
}
|
|
symbol(sym) {
|
|
return this.write("symbol:" + sym.toString());
|
|
}
|
|
unknown(value, type) {
|
|
this.write(type);
|
|
if (!value) {
|
|
return;
|
|
}
|
|
this.write(":");
|
|
if (value && typeof value.entries === "function") {
|
|
return this.array(
|
|
[...value.entries()],
|
|
true
|
|
/* ordered */
|
|
);
|
|
}
|
|
}
|
|
error(err) {
|
|
return this.write("error:" + err.toString());
|
|
}
|
|
boolean(bool) {
|
|
return this.write("bool:" + bool);
|
|
}
|
|
string(string) {
|
|
this.write("string:" + string.length + ":");
|
|
this.write(string);
|
|
}
|
|
function(fn) {
|
|
this.write("fn:");
|
|
if (isNativeFunction(fn)) {
|
|
this.dispatch("[native]");
|
|
} else {
|
|
this.dispatch(fn.toString());
|
|
}
|
|
}
|
|
number(number) {
|
|
return this.write("number:" + number);
|
|
}
|
|
null() {
|
|
return this.write("Null");
|
|
}
|
|
undefined() {
|
|
return this.write("Undefined");
|
|
}
|
|
regexp(regex) {
|
|
return this.write("regex:" + regex.toString());
|
|
}
|
|
arraybuffer(arr) {
|
|
this.write("arraybuffer:");
|
|
return this.dispatch(new Uint8Array(arr));
|
|
}
|
|
url(url) {
|
|
return this.write("url:" + url.toString());
|
|
}
|
|
map(map) {
|
|
this.write("map:");
|
|
const arr = [...map];
|
|
return this.array(arr, false);
|
|
}
|
|
set(set) {
|
|
this.write("set:");
|
|
const arr = [...set];
|
|
return this.array(arr, false);
|
|
}
|
|
bigint(number) {
|
|
return this.write("bigint:" + number.toString());
|
|
}
|
|
}
|
|
for (const type of [
|
|
"uint8array",
|
|
"uint8clampedarray",
|
|
"unt8array",
|
|
"uint16array",
|
|
"unt16array",
|
|
"uint32array",
|
|
"unt32array",
|
|
"float32array",
|
|
"float64array"
|
|
]) {
|
|
Hasher2.prototype[type] = function(arr) {
|
|
this.write(type + ":");
|
|
return this.array([...arr], false);
|
|
};
|
|
}
|
|
function isNativeFunction(f) {
|
|
if (typeof f !== "function") {
|
|
return false;
|
|
}
|
|
return Function.prototype.toString.call(f).slice(
|
|
-15
|
|
/* "[native code] }".length */
|
|
) === "[native code] }";
|
|
}
|
|
return Hasher2;
|
|
})();
|
|
function serialize(object) {
|
|
const hasher = new Hasher();
|
|
hasher.dispatch(object);
|
|
return hasher.buff;
|
|
}
|
|
function hash(value) {
|
|
return digest(typeof value === "string" ? value : serialize(value)).replace(/[-_]/g, "").slice(0, 10);
|
|
}
|
|
|
|
function defaultCacheOptions() {
|
|
return {
|
|
name: "_",
|
|
base: "/cache",
|
|
swr: true,
|
|
maxAge: 1
|
|
};
|
|
}
|
|
function defineCachedFunction(fn, opts = {}) {
|
|
opts = { ...defaultCacheOptions(), ...opts };
|
|
const pending = {};
|
|
const group = opts.group || "nitro/functions";
|
|
const name = opts.name || fn.name || "_";
|
|
const integrity = opts.integrity || hash([fn, opts]);
|
|
const validate = opts.validate || ((entry) => entry.value !== void 0);
|
|
async function get(key, resolver, shouldInvalidateCache, event) {
|
|
const cacheKey = [opts.base, group, name, key + ".json"].filter(Boolean).join(":").replace(/:\/$/, ":index");
|
|
let entry = await useStorage().getItem(cacheKey).catch((error) => {
|
|
console.error(`[cache] Cache read error.`, error);
|
|
useNitroApp().captureError(error, { event, tags: ["cache"] });
|
|
}) || {};
|
|
if (typeof entry !== "object") {
|
|
entry = {};
|
|
const error = new Error("Malformed data read from cache.");
|
|
console.error("[cache]", error);
|
|
useNitroApp().captureError(error, { event, tags: ["cache"] });
|
|
}
|
|
const ttl = (opts.maxAge ?? 0) * 1e3;
|
|
if (ttl) {
|
|
entry.expires = Date.now() + ttl;
|
|
}
|
|
const expired = shouldInvalidateCache || entry.integrity !== integrity || ttl && Date.now() - (entry.mtime || 0) > ttl || validate(entry) === false;
|
|
const _resolve = async () => {
|
|
const isPending = pending[key];
|
|
if (!isPending) {
|
|
if (entry.value !== void 0 && (opts.staleMaxAge || 0) >= 0 && opts.swr === false) {
|
|
entry.value = void 0;
|
|
entry.integrity = void 0;
|
|
entry.mtime = void 0;
|
|
entry.expires = void 0;
|
|
}
|
|
pending[key] = Promise.resolve(resolver());
|
|
}
|
|
try {
|
|
entry.value = await pending[key];
|
|
} catch (error) {
|
|
if (!isPending) {
|
|
delete pending[key];
|
|
}
|
|
throw error;
|
|
}
|
|
if (!isPending) {
|
|
entry.mtime = Date.now();
|
|
entry.integrity = integrity;
|
|
delete pending[key];
|
|
if (validate(entry) !== false) {
|
|
let setOpts;
|
|
if (opts.maxAge && !opts.swr) {
|
|
setOpts = { ttl: opts.maxAge };
|
|
}
|
|
const promise = useStorage().setItem(cacheKey, entry, setOpts).catch((error) => {
|
|
console.error(`[cache] Cache write error.`, error);
|
|
useNitroApp().captureError(error, { event, tags: ["cache"] });
|
|
});
|
|
if (event?.waitUntil) {
|
|
event.waitUntil(promise);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const _resolvePromise = expired ? _resolve() : Promise.resolve();
|
|
if (entry.value === void 0) {
|
|
await _resolvePromise;
|
|
} else if (expired && event && event.waitUntil) {
|
|
event.waitUntil(_resolvePromise);
|
|
}
|
|
if (opts.swr && validate(entry) !== false) {
|
|
_resolvePromise.catch((error) => {
|
|
console.error(`[cache] SWR handler error.`, error);
|
|
useNitroApp().captureError(error, { event, tags: ["cache"] });
|
|
});
|
|
return entry;
|
|
}
|
|
return _resolvePromise.then(() => entry);
|
|
}
|
|
return async (...args) => {
|
|
const shouldBypassCache = await opts.shouldBypassCache?.(...args);
|
|
if (shouldBypassCache) {
|
|
return fn(...args);
|
|
}
|
|
const key = await (opts.getKey || getKey)(...args);
|
|
const shouldInvalidateCache = await opts.shouldInvalidateCache?.(...args);
|
|
const entry = await get(
|
|
key,
|
|
() => fn(...args),
|
|
shouldInvalidateCache,
|
|
args[0] && isEvent(args[0]) ? args[0] : void 0
|
|
);
|
|
let value = entry.value;
|
|
if (opts.transform) {
|
|
value = await opts.transform(entry, ...args) || value;
|
|
}
|
|
return value;
|
|
};
|
|
}
|
|
function cachedFunction(fn, opts = {}) {
|
|
return defineCachedFunction(fn, opts);
|
|
}
|
|
function getKey(...args) {
|
|
return args.length > 0 ? hash(args) : "";
|
|
}
|
|
function escapeKey(key) {
|
|
return String(key).replace(/\W/g, "");
|
|
}
|
|
function defineCachedEventHandler(handler, opts = defaultCacheOptions()) {
|
|
const variableHeaderNames = (opts.varies || []).filter(Boolean).map((h) => h.toLowerCase()).sort();
|
|
const _opts = {
|
|
...opts,
|
|
getKey: async (event) => {
|
|
const customKey = await opts.getKey?.(event);
|
|
if (customKey) {
|
|
return escapeKey(customKey);
|
|
}
|
|
const _path = event.node.req.originalUrl || event.node.req.url || event.path;
|
|
let _pathname;
|
|
try {
|
|
_pathname = escapeKey(decodeURI(parseURL(_path).pathname)).slice(0, 16) || "index";
|
|
} catch {
|
|
_pathname = "-";
|
|
}
|
|
const _hashedPath = `${_pathname}.${hash(_path)}`;
|
|
const _headers = variableHeaderNames.map((header) => [header, event.node.req.headers[header]]).map(([name, value]) => `${escapeKey(name)}.${hash(value)}`);
|
|
return [_hashedPath, ..._headers].join(":");
|
|
},
|
|
validate: (entry) => {
|
|
if (!entry.value) {
|
|
return false;
|
|
}
|
|
if (entry.value.code >= 400) {
|
|
return false;
|
|
}
|
|
if (entry.value.body === void 0) {
|
|
return false;
|
|
}
|
|
if (entry.value.headers.etag === "undefined" || entry.value.headers["last-modified"] === "undefined") {
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
group: opts.group || "nitro/handlers",
|
|
integrity: opts.integrity || hash([handler, opts])
|
|
};
|
|
const _cachedHandler = cachedFunction(
|
|
async (incomingEvent) => {
|
|
const variableHeaders = {};
|
|
for (const header of variableHeaderNames) {
|
|
const value = incomingEvent.node.req.headers[header];
|
|
if (value !== void 0) {
|
|
variableHeaders[header] = value;
|
|
}
|
|
}
|
|
const reqProxy = cloneWithProxy(incomingEvent.node.req, {
|
|
headers: variableHeaders
|
|
});
|
|
const resHeaders = {};
|
|
let _resSendBody;
|
|
const resProxy = cloneWithProxy(incomingEvent.node.res, {
|
|
statusCode: 200,
|
|
writableEnded: false,
|
|
writableFinished: false,
|
|
headersSent: false,
|
|
closed: false,
|
|
getHeader(name) {
|
|
return resHeaders[name];
|
|
},
|
|
setHeader(name, value) {
|
|
resHeaders[name] = value;
|
|
return this;
|
|
},
|
|
getHeaderNames() {
|
|
return Object.keys(resHeaders);
|
|
},
|
|
hasHeader(name) {
|
|
return name in resHeaders;
|
|
},
|
|
removeHeader(name) {
|
|
delete resHeaders[name];
|
|
},
|
|
getHeaders() {
|
|
return resHeaders;
|
|
},
|
|
end(chunk, arg2, arg3) {
|
|
if (typeof chunk === "string") {
|
|
_resSendBody = chunk;
|
|
}
|
|
if (typeof arg2 === "function") {
|
|
arg2();
|
|
}
|
|
if (typeof arg3 === "function") {
|
|
arg3();
|
|
}
|
|
return this;
|
|
},
|
|
write(chunk, arg2, arg3) {
|
|
if (typeof chunk === "string") {
|
|
_resSendBody = chunk;
|
|
}
|
|
if (typeof arg2 === "function") {
|
|
arg2(void 0);
|
|
}
|
|
if (typeof arg3 === "function") {
|
|
arg3();
|
|
}
|
|
return true;
|
|
},
|
|
writeHead(statusCode, headers2) {
|
|
this.statusCode = statusCode;
|
|
if (headers2) {
|
|
if (Array.isArray(headers2) || typeof headers2 === "string") {
|
|
throw new TypeError("Raw headers is not supported.");
|
|
}
|
|
for (const header in headers2) {
|
|
const value = headers2[header];
|
|
if (value !== void 0) {
|
|
this.setHeader(
|
|
header,
|
|
value
|
|
);
|
|
}
|
|
}
|
|
}
|
|
return this;
|
|
}
|
|
});
|
|
const event = createEvent(reqProxy, resProxy);
|
|
event.fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, {
|
|
fetch: useNitroApp().localFetch
|
|
});
|
|
event.$fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, {
|
|
fetch: globalThis.$fetch
|
|
});
|
|
event.waitUntil = incomingEvent.waitUntil;
|
|
event.context = incomingEvent.context;
|
|
event.context.cache = {
|
|
options: _opts
|
|
};
|
|
const body = await handler(event) || _resSendBody;
|
|
const headers = event.node.res.getHeaders();
|
|
headers.etag = String(
|
|
headers.Etag || headers.etag || `W/"${hash(body)}"`
|
|
);
|
|
headers["last-modified"] = String(
|
|
headers["Last-Modified"] || headers["last-modified"] || (/* @__PURE__ */ new Date()).toUTCString()
|
|
);
|
|
const cacheControl = [];
|
|
if (opts.swr) {
|
|
if (opts.maxAge) {
|
|
cacheControl.push(`s-maxage=${opts.maxAge}`);
|
|
}
|
|
if (opts.staleMaxAge) {
|
|
cacheControl.push(`stale-while-revalidate=${opts.staleMaxAge}`);
|
|
} else {
|
|
cacheControl.push("stale-while-revalidate");
|
|
}
|
|
} else if (opts.maxAge) {
|
|
cacheControl.push(`max-age=${opts.maxAge}`);
|
|
}
|
|
if (cacheControl.length > 0) {
|
|
headers["cache-control"] = cacheControl.join(", ");
|
|
}
|
|
const cacheEntry = {
|
|
code: event.node.res.statusCode,
|
|
headers,
|
|
body
|
|
};
|
|
return cacheEntry;
|
|
},
|
|
_opts
|
|
);
|
|
return defineEventHandler(async (event) => {
|
|
if (opts.headersOnly) {
|
|
if (handleCacheHeaders(event, { maxAge: opts.maxAge })) {
|
|
return;
|
|
}
|
|
return handler(event);
|
|
}
|
|
const response = await _cachedHandler(
|
|
event
|
|
);
|
|
if (event.node.res.headersSent || event.node.res.writableEnded) {
|
|
return response.body;
|
|
}
|
|
if (handleCacheHeaders(event, {
|
|
modifiedTime: new Date(response.headers["last-modified"]),
|
|
etag: response.headers.etag,
|
|
maxAge: opts.maxAge
|
|
})) {
|
|
return;
|
|
}
|
|
event.node.res.statusCode = response.code;
|
|
for (const name in response.headers) {
|
|
const value = response.headers[name];
|
|
if (name === "set-cookie") {
|
|
event.node.res.appendHeader(
|
|
name,
|
|
splitCookiesString(value)
|
|
);
|
|
} else {
|
|
if (value !== void 0) {
|
|
event.node.res.setHeader(name, value);
|
|
}
|
|
}
|
|
}
|
|
return response.body;
|
|
});
|
|
}
|
|
function cloneWithProxy(obj, overrides) {
|
|
return new Proxy(obj, {
|
|
get(target, property, receiver) {
|
|
if (property in overrides) {
|
|
return overrides[property];
|
|
}
|
|
return Reflect.get(target, property, receiver);
|
|
},
|
|
set(target, property, value, receiver) {
|
|
if (property in overrides) {
|
|
overrides[property] = value;
|
|
return true;
|
|
}
|
|
return Reflect.set(target, property, value, receiver);
|
|
}
|
|
});
|
|
}
|
|
const cachedEventHandler = defineCachedEventHandler;
|
|
|
|
const inlineAppConfig = {
|
|
"nuxt": {}
|
|
};
|
|
|
|
|
|
|
|
const appConfig = defuFn(inlineAppConfig);
|
|
|
|
function getEnv(key, opts) {
|
|
const envKey = snakeCase(key).toUpperCase();
|
|
return destr(
|
|
process.env[opts.prefix + envKey] ?? process.env[opts.altPrefix + envKey]
|
|
);
|
|
}
|
|
function _isObject(input) {
|
|
return typeof input === "object" && !Array.isArray(input);
|
|
}
|
|
function applyEnv(obj, opts, parentKey = "") {
|
|
for (const key in obj) {
|
|
const subKey = parentKey ? `${parentKey}_${key}` : key;
|
|
const envValue = getEnv(subKey, opts);
|
|
if (_isObject(obj[key])) {
|
|
if (_isObject(envValue)) {
|
|
obj[key] = { ...obj[key], ...envValue };
|
|
applyEnv(obj[key], opts, subKey);
|
|
} else if (envValue === void 0) {
|
|
applyEnv(obj[key], opts, subKey);
|
|
} else {
|
|
obj[key] = envValue ?? obj[key];
|
|
}
|
|
} else {
|
|
obj[key] = envValue ?? obj[key];
|
|
}
|
|
if (opts.envExpansion && typeof obj[key] === "string") {
|
|
obj[key] = _expandFromEnv(obj[key]);
|
|
}
|
|
}
|
|
return obj;
|
|
}
|
|
const envExpandRx = /\{\{([^{}]*)\}\}/g;
|
|
function _expandFromEnv(value) {
|
|
return value.replace(envExpandRx, (match, key) => {
|
|
return process.env[key] || match;
|
|
});
|
|
}
|
|
|
|
const _inlineRuntimeConfig = {
|
|
"app": {
|
|
"baseURL": "/",
|
|
"buildId": "dev",
|
|
"buildAssetsDir": "/_nuxt/",
|
|
"cdnURL": ""
|
|
},
|
|
"nitro": {
|
|
"envPrefix": "NUXT_",
|
|
"routeRules": {
|
|
"/__nuxt_error": {
|
|
"cache": false
|
|
},
|
|
"/__nuxt_content/**": {
|
|
"robots": false,
|
|
"cache": false
|
|
},
|
|
"/__nuxt_content/docs/sql_dump.txt": {
|
|
"prerender": true
|
|
}
|
|
}
|
|
},
|
|
"public": {
|
|
"tenantId": "5",
|
|
"serverApiBase": "https://server.websoft.top/api",
|
|
"modulesApiBase": "https://mp-api.websoft.top/api",
|
|
"appApiBase": "https://websopy-api.websoft.top",
|
|
"mpApiBase": "https://mp-api.websoft.top",
|
|
"fileServerBase": "https://server.websoft.top",
|
|
"templateId": "5",
|
|
"ServerApi": "https://server.websoft.top/api",
|
|
"ApiBase": "https://mp-api.websoft.top/api",
|
|
"TenantId": "5",
|
|
"mdc": {
|
|
"components": {
|
|
"prose": true,
|
|
"map": {},
|
|
"customElements": []
|
|
},
|
|
"headings": {
|
|
"anchorLinks": {
|
|
"h1": false,
|
|
"h2": true,
|
|
"h3": true,
|
|
"h4": true,
|
|
"h5": false,
|
|
"h6": false
|
|
}
|
|
},
|
|
"highlight": {
|
|
"noApiRoute": true,
|
|
"highlighter": "shiki",
|
|
"theme": {
|
|
"default": "github-light",
|
|
"dark": "github-dark"
|
|
},
|
|
"shikiEngine": "oniguruma",
|
|
"langs": [
|
|
"js",
|
|
"jsx",
|
|
"json",
|
|
"ts",
|
|
"tsx",
|
|
"vue",
|
|
"css",
|
|
"html",
|
|
"bash",
|
|
"md",
|
|
"mdc",
|
|
"yaml"
|
|
]
|
|
}
|
|
},
|
|
"content": {
|
|
"wsUrl": ""
|
|
},
|
|
"i18n": {
|
|
"baseUrl": "",
|
|
"defaultLocale": "zh-CN",
|
|
"rootRedirect": "",
|
|
"redirectStatusCode": 302,
|
|
"skipSettingLocaleOnNavigate": false,
|
|
"locales": [
|
|
{
|
|
"code": "zh-CN",
|
|
"name": "简体中文",
|
|
"language": ""
|
|
},
|
|
{
|
|
"code": "en",
|
|
"name": "English",
|
|
"language": ""
|
|
}
|
|
],
|
|
"detectBrowserLanguage": {
|
|
"alwaysRedirect": true,
|
|
"cookieCrossOrigin": false,
|
|
"cookieDomain": "",
|
|
"cookieKey": "i18n_locale",
|
|
"cookieSecure": false,
|
|
"fallbackLocale": "zh-CN",
|
|
"redirectOn": "root",
|
|
"useCookie": true
|
|
},
|
|
"experimental": {
|
|
"localeDetector": "",
|
|
"typedPages": true,
|
|
"typedOptionsAndMessages": false,
|
|
"alternateLinkCanonicalQueries": true,
|
|
"devCache": false,
|
|
"cacheLifetime": "",
|
|
"stripMessagesPayload": false,
|
|
"preload": false,
|
|
"strictSeo": false,
|
|
"nitroContextDetection": true,
|
|
"httpCacheDuration": 10
|
|
},
|
|
"domainLocales": {
|
|
"zh-CN": {
|
|
"domain": ""
|
|
},
|
|
"en": {
|
|
"domain": ""
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"content": {
|
|
"databaseVersion": "v3.5.0",
|
|
"version": "3.12.0",
|
|
"database": {
|
|
"type": "sqlite",
|
|
"filename": "./contents.sqlite"
|
|
},
|
|
"localDatabase": {
|
|
"type": "sqlite",
|
|
"filename": "/Users/gxwebsoft/VUE/tiantian-system/.data/content/contents.sqlite"
|
|
},
|
|
"integrityCheck": true
|
|
}
|
|
};
|
|
const envOptions = {
|
|
prefix: "NITRO_",
|
|
altPrefix: _inlineRuntimeConfig.nitro.envPrefix ?? process.env.NITRO_ENV_PREFIX ?? "_",
|
|
envExpansion: _inlineRuntimeConfig.nitro.envExpansion ?? process.env.NITRO_ENV_EXPANSION ?? false
|
|
};
|
|
const _sharedRuntimeConfig = _deepFreeze(
|
|
applyEnv(klona(_inlineRuntimeConfig), envOptions)
|
|
);
|
|
function useRuntimeConfig(event) {
|
|
if (!event) {
|
|
return _sharedRuntimeConfig;
|
|
}
|
|
if (event.context.nitro.runtimeConfig) {
|
|
return event.context.nitro.runtimeConfig;
|
|
}
|
|
const runtimeConfig = klona(_inlineRuntimeConfig);
|
|
applyEnv(runtimeConfig, envOptions);
|
|
event.context.nitro.runtimeConfig = runtimeConfig;
|
|
return runtimeConfig;
|
|
}
|
|
_deepFreeze(klona(appConfig));
|
|
function _deepFreeze(object) {
|
|
const propNames = Object.getOwnPropertyNames(object);
|
|
for (const name of propNames) {
|
|
const value = object[name];
|
|
if (value && typeof value === "object") {
|
|
_deepFreeze(value);
|
|
}
|
|
}
|
|
return Object.freeze(object);
|
|
}
|
|
new Proxy(/* @__PURE__ */ Object.create(null), {
|
|
get: (_, prop) => {
|
|
console.warn(
|
|
"Please use `useRuntimeConfig()` instead of accessing config directly."
|
|
);
|
|
const runtimeConfig = useRuntimeConfig();
|
|
if (prop in runtimeConfig) {
|
|
return runtimeConfig[prop];
|
|
}
|
|
return void 0;
|
|
}
|
|
});
|
|
|
|
getContext("nitro-app", {
|
|
asyncContext: false,
|
|
AsyncLocalStorage: void 0
|
|
});
|
|
|
|
const config = useRuntimeConfig();
|
|
const _routeRulesMatcher = toRouteMatcher(
|
|
createRouter({ routes: config.nitro.routeRules })
|
|
);
|
|
function createRouteRulesHandler(ctx) {
|
|
return eventHandler((event) => {
|
|
const routeRules = getRouteRules(event);
|
|
if (routeRules.headers) {
|
|
setHeaders(event, routeRules.headers);
|
|
}
|
|
if (routeRules.redirect) {
|
|
let target = routeRules.redirect.to;
|
|
if (target.endsWith("/**")) {
|
|
let targetPath = event.path;
|
|
const strpBase = routeRules.redirect._redirectStripBase;
|
|
if (strpBase) {
|
|
targetPath = withoutBase(targetPath, strpBase);
|
|
}
|
|
target = joinURL$5(target.slice(0, -3), targetPath);
|
|
} else if (event.path.includes("?")) {
|
|
const query = getQuery(event.path);
|
|
target = withQuery(target, query);
|
|
}
|
|
return sendRedirect(event, target, routeRules.redirect.statusCode);
|
|
}
|
|
if (routeRules.proxy) {
|
|
let target = routeRules.proxy.to;
|
|
if (target.endsWith("/**")) {
|
|
let targetPath = event.path;
|
|
const strpBase = routeRules.proxy._proxyStripBase;
|
|
if (strpBase) {
|
|
targetPath = withoutBase(targetPath, strpBase);
|
|
}
|
|
target = joinURL$5(target.slice(0, -3), targetPath);
|
|
} else if (event.path.includes("?")) {
|
|
const query = getQuery(event.path);
|
|
target = withQuery(target, query);
|
|
}
|
|
return proxyRequest(event, target, {
|
|
fetch: ctx.localFetch,
|
|
...routeRules.proxy
|
|
});
|
|
}
|
|
});
|
|
}
|
|
function getRouteRules(event) {
|
|
event.context._nitro = event.context._nitro || {};
|
|
if (!event.context._nitro.routeRules) {
|
|
event.context._nitro.routeRules = getRouteRulesForPath(
|
|
withoutBase(event.path.split("?")[0], useRuntimeConfig().app.baseURL)
|
|
);
|
|
}
|
|
return event.context._nitro.routeRules;
|
|
}
|
|
function getRouteRulesForPath(path) {
|
|
return defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
|
|
}
|
|
|
|
function _captureError(error, type) {
|
|
console.error(`[${type}]`, error);
|
|
useNitroApp().captureError(error, { tags: [type] });
|
|
}
|
|
function trapUnhandledNodeErrors() {
|
|
process.on(
|
|
"unhandledRejection",
|
|
(error) => _captureError(error, "unhandledRejection")
|
|
);
|
|
process.on(
|
|
"uncaughtException",
|
|
(error) => _captureError(error, "uncaughtException")
|
|
);
|
|
}
|
|
function joinHeaders(value) {
|
|
return Array.isArray(value) ? value.join(", ") : String(value);
|
|
}
|
|
function normalizeFetchResponse(response) {
|
|
if (!response.headers.has("set-cookie")) {
|
|
return response;
|
|
}
|
|
return new Response(response.body, {
|
|
status: response.status,
|
|
statusText: response.statusText,
|
|
headers: normalizeCookieHeaders(response.headers)
|
|
});
|
|
}
|
|
function normalizeCookieHeader(header = "") {
|
|
return splitCookiesString(joinHeaders(header));
|
|
}
|
|
function normalizeCookieHeaders(headers) {
|
|
const outgoingHeaders = new Headers();
|
|
for (const [name, header] of headers) {
|
|
if (name === "set-cookie") {
|
|
for (const cookie of normalizeCookieHeader(header)) {
|
|
outgoingHeaders.append("set-cookie", cookie);
|
|
}
|
|
} else {
|
|
outgoingHeaders.set(name, joinHeaders(header));
|
|
}
|
|
}
|
|
return outgoingHeaders;
|
|
}
|
|
|
|
function isJsonRequest(event) {
|
|
if (hasReqHeader(event, "accept", "text/html")) {
|
|
return false;
|
|
}
|
|
return hasReqHeader(event, "accept", "application/json") || hasReqHeader(event, "user-agent", "curl/") || hasReqHeader(event, "user-agent", "httpie/") || hasReqHeader(event, "sec-fetch-mode", "cors") || event.path.startsWith("/api/") || event.path.endsWith(".json");
|
|
}
|
|
function hasReqHeader(event, name, includes) {
|
|
const value = getRequestHeader(event, name);
|
|
return value && typeof value === "string" && value.toLowerCase().includes(includes);
|
|
}
|
|
|
|
const iframeStorageBridge = (nonce) => (
|
|
/* js */
|
|
`
|
|
(function() {
|
|
const memoryStore = {};
|
|
|
|
const NONCE = ${JSON.stringify(nonce)}
|
|
|
|
const mockStorage = {
|
|
getItem: function(key) {
|
|
return memoryStore[key] !== undefined ? memoryStore[key] : null;
|
|
},
|
|
setItem: function(key, value) {
|
|
memoryStore[key] = String(value);
|
|
window.parent.postMessage({
|
|
type: 'storage-set',
|
|
key: key,
|
|
value: String(value),
|
|
nonce: NONCE
|
|
}, '*');
|
|
},
|
|
removeItem: function(key) {
|
|
delete memoryStore[key];
|
|
window.parent.postMessage({
|
|
type: 'storage-remove',
|
|
key: key,
|
|
nonce: NONCE
|
|
}, '*');
|
|
},
|
|
clear: function() {
|
|
for (const key in memoryStore) {
|
|
delete memoryStore[key];
|
|
}
|
|
window.parent.postMessage({
|
|
type: 'storage-clear',
|
|
nonce: NONCE
|
|
}, '*');
|
|
},
|
|
key: function(index) {
|
|
const keys = Object.keys(memoryStore);
|
|
return keys[index] !== undefined ? keys[index] : null;
|
|
},
|
|
get length() {
|
|
return Object.keys(memoryStore).length;
|
|
}
|
|
};
|
|
|
|
try {
|
|
Object.defineProperty(window, 'localStorage', {
|
|
value: mockStorage,
|
|
writable: false,
|
|
configurable: true
|
|
});
|
|
} catch (e) {
|
|
window.localStorage = mockStorage;
|
|
}
|
|
|
|
window.addEventListener('message', function(event) {
|
|
if (event.data.type === 'storage-sync-data' && event.data.nonce === NONCE) {
|
|
const data = event.data.data;
|
|
for (const key in data) {
|
|
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
memoryStore[key] = data[key];
|
|
}
|
|
}
|
|
if (typeof window.initTheme === 'function') {
|
|
window.initTheme();
|
|
}
|
|
window.dispatchEvent(new Event('storage-ready'));
|
|
}
|
|
});
|
|
|
|
window.parent.postMessage({
|
|
type: 'storage-sync-request',
|
|
nonce: NONCE
|
|
}, '*');
|
|
})();
|
|
`
|
|
);
|
|
const parentStorageBridge = (nonce) => (
|
|
/* js */
|
|
`
|
|
(function() {
|
|
const host = document.querySelector('nuxt-error-overlay');
|
|
if (!host) return;
|
|
|
|
// Wait for shadow root to be attached
|
|
const checkShadow = setInterval(function() {
|
|
if (host.shadowRoot) {
|
|
clearInterval(checkShadow);
|
|
const iframe = host.shadowRoot.getElementById('frame');
|
|
if (!iframe) return;
|
|
|
|
const NONCE = ${JSON.stringify(nonce)}
|
|
|
|
window.addEventListener('message', function(event) {
|
|
if (!event.data || event.data.nonce !== NONCE) return;
|
|
|
|
const data = event.data;
|
|
|
|
if (data.type === 'storage-set') {
|
|
localStorage.setItem(data.key, data.value);
|
|
} else if (data.type === 'storage-remove') {
|
|
localStorage.removeItem(data.key);
|
|
} else if (data.type === 'storage-clear') {
|
|
localStorage.clear();
|
|
} else if (data.type === 'storage-sync-request') {
|
|
const allData = {};
|
|
for (let i = 0; i < localStorage.length; i++) {
|
|
const key = localStorage.key(i);
|
|
allData[key] = localStorage.getItem(key);
|
|
}
|
|
iframe.contentWindow.postMessage({
|
|
type: 'storage-sync-data',
|
|
data: allData,
|
|
nonce: NONCE
|
|
}, '*');
|
|
}
|
|
});
|
|
}
|
|
}, 10);
|
|
})();
|
|
`
|
|
);
|
|
const errorCSS = (
|
|
/* css */
|
|
`
|
|
:host {
|
|
--preview-width: 240px;
|
|
--preview-height: 180px;
|
|
--base-width: 1200px;
|
|
--base-height: 900px;
|
|
--z-base: 999999998;
|
|
all: initial;
|
|
display: contents;
|
|
}
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border-width: 0;
|
|
}
|
|
#frame {
|
|
position: fixed;
|
|
left: 0;
|
|
top: 0;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
border: none;
|
|
z-index: var(--z-base);
|
|
}
|
|
#frame[inert] {
|
|
right: 5px;
|
|
bottom: 5px;
|
|
left: auto;
|
|
top: auto;
|
|
width: var(--base-width);
|
|
height: var(--base-height);
|
|
transform: scale(calc(240 / 1200));
|
|
transform-origin: bottom right;
|
|
overflow: hidden;
|
|
border-radius: calc(1200 * 8px / 240);
|
|
}
|
|
#preview {
|
|
position: fixed;
|
|
right: 5px;
|
|
bottom: 5px;
|
|
width: var(--preview-width);
|
|
height: var(--preview-height);
|
|
overflow: hidden;
|
|
border-radius: 8px;
|
|
pointer-events: none;
|
|
z-index: var(--z-base);
|
|
background: white;
|
|
display: none;
|
|
}
|
|
#frame:not([inert]) + #preview {
|
|
display: block;
|
|
}
|
|
#toggle {
|
|
position: fixed;
|
|
right: 5px;
|
|
bottom: 5px;
|
|
width: var(--preview-width);
|
|
height: var(--preview-height);
|
|
background: none;
|
|
border: 3px solid #00DC82;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
opacity: 0.8;
|
|
transition: opacity 0.2s, box-shadow 0.2s;
|
|
z-index: calc(var(--z-base) + 1);
|
|
}
|
|
#toggle:hover,
|
|
#toggle:focus {
|
|
opacity: 1;
|
|
box-shadow: 0 0 20px rgba(0, 220, 130, 0.6);
|
|
}
|
|
#toggle:focus-visible {
|
|
outline: 3px solid #00DC82;
|
|
outline-offset: 3px;
|
|
box-shadow: 0 0 24px rgba(0, 220, 130, 0.8);
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
#toggle {
|
|
transition: none;
|
|
}
|
|
}
|
|
`
|
|
);
|
|
function webComponentScript(base64HTML, startMinimized) {
|
|
return (
|
|
/* js */
|
|
`
|
|
(function() {
|
|
try {
|
|
const host = document.querySelector('nuxt-error-overlay');
|
|
if (!host) return;
|
|
|
|
const shadow = host.attachShadow({ mode: 'open' });
|
|
|
|
// Create elements
|
|
const style = document.createElement('style');
|
|
style.textContent = ${JSON.stringify(errorCSS)};
|
|
|
|
const iframe = document.createElement('iframe');
|
|
iframe.id = 'frame';
|
|
iframe.src = 'data:text/html;base64,${base64HTML}';
|
|
iframe.title = 'Detailed error stack trace';
|
|
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');
|
|
|
|
const preview = document.createElement('div');
|
|
preview.id = 'preview';
|
|
|
|
const button = document.createElement('button');
|
|
button.id = 'toggle';
|
|
button.setAttribute('aria-expanded', 'true');
|
|
button.setAttribute('type', 'button');
|
|
button.innerHTML = '<span class="sr-only">Toggle detailed error view</span>';
|
|
|
|
const liveRegion = document.createElement('div');
|
|
liveRegion.setAttribute('role', 'status');
|
|
liveRegion.setAttribute('aria-live', 'polite');
|
|
liveRegion.className = 'sr-only';
|
|
|
|
// Update preview snapshot
|
|
function updatePreview() {
|
|
try {
|
|
let previewIframe = preview.querySelector('iframe');
|
|
if (!previewIframe) {
|
|
previewIframe = document.createElement('iframe');
|
|
previewIframe.style.cssText = 'width: 1200px; height: 900px; transform: scale(0.2); transform-origin: top left; border: none;';
|
|
previewIframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');
|
|
preview.appendChild(previewIframe);
|
|
}
|
|
|
|
const doctype = document.doctype ? '<!DOCTYPE ' + document.doctype.name + '>' : '';
|
|
const cleanedHTML = document.documentElement.outerHTML
|
|
.replace(/<nuxt-error-overlay[^>]*>.*?<\\/nuxt-error-overlay>/gs, '')
|
|
.replace(/<script[^>]*>.*?<\\/script>/gs, '');
|
|
|
|
const iframeDoc = previewIframe.contentDocument || previewIframe.contentWindow.document;
|
|
iframeDoc.open();
|
|
iframeDoc.write(doctype + cleanedHTML);
|
|
iframeDoc.close();
|
|
} catch (error) {
|
|
console.error('Failed to update preview:', error);
|
|
}
|
|
}
|
|
|
|
function toggleView() {
|
|
const isMinimized = iframe.hasAttribute('inert');
|
|
|
|
if (isMinimized) {
|
|
updatePreview();
|
|
iframe.removeAttribute('inert');
|
|
button.setAttribute('aria-expanded', 'true');
|
|
liveRegion.textContent = 'Showing detailed error view';
|
|
setTimeout(function() {
|
|
try { iframe.contentWindow.focus(); } catch {}
|
|
}, 100);
|
|
} else {
|
|
iframe.setAttribute('inert', '');
|
|
button.setAttribute('aria-expanded', 'false');
|
|
liveRegion.textContent = 'Showing error page';
|
|
button.focus();
|
|
}
|
|
}
|
|
|
|
button.onclick = toggleView;
|
|
|
|
document.addEventListener('keydown', function(e) {
|
|
if ((e.key === 'Escape' || e.key === 'Esc') && !iframe.hasAttribute('inert')) {
|
|
toggleView();
|
|
}
|
|
});
|
|
|
|
// Append to shadow DOM
|
|
shadow.appendChild(style);
|
|
shadow.appendChild(liveRegion);
|
|
shadow.appendChild(iframe);
|
|
shadow.appendChild(preview);
|
|
shadow.appendChild(button);
|
|
|
|
if (${startMinimized}) {
|
|
iframe.setAttribute('inert', '');
|
|
button.setAttribute('aria-expanded', 'false');
|
|
}
|
|
|
|
// Initialize preview
|
|
setTimeout(updatePreview, 100);
|
|
|
|
} catch (error) {
|
|
console.error('Failed to initialize Nuxt error overlay:', error);
|
|
}
|
|
})();
|
|
`
|
|
);
|
|
}
|
|
function generateErrorOverlayHTML(html, options) {
|
|
const nonce = Array.from(crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
const errorPage = html.replace("<head>", `<head><script>${iframeStorageBridge(nonce)}<\/script>`);
|
|
const base64HTML = Buffer.from(errorPage, "utf8").toString("base64");
|
|
return `
|
|
<script>${parentStorageBridge(nonce)}<\/script>
|
|
<nuxt-error-overlay></nuxt-error-overlay>
|
|
<script>${webComponentScript(base64HTML, options?.startMinimized ?? false)}<\/script>
|
|
`;
|
|
}
|
|
|
|
const errorHandler$0 = (async function errorhandler(error, event, { defaultHandler }) {
|
|
if (event.handled || isJsonRequest(event)) {
|
|
return;
|
|
}
|
|
const defaultRes = await defaultHandler(error, event, { json: true });
|
|
const statusCode = error.statusCode || 500;
|
|
if (statusCode === 404 && defaultRes.status === 302) {
|
|
setResponseHeaders(event, defaultRes.headers);
|
|
setResponseStatus(event, defaultRes.status, defaultRes.statusText);
|
|
return send(event, JSON.stringify(defaultRes.body, null, 2));
|
|
}
|
|
if (typeof defaultRes.body !== "string" && Array.isArray(defaultRes.body.stack)) {
|
|
defaultRes.body.stack = defaultRes.body.stack.join("\n");
|
|
}
|
|
const errorObject = defaultRes.body;
|
|
const url = new URL(errorObject.url);
|
|
errorObject.url = withoutBase(url.pathname, useRuntimeConfig(event).app.baseURL) + url.search + url.hash;
|
|
errorObject.message ||= "Server Error";
|
|
errorObject.data ||= error.data;
|
|
errorObject.statusMessage ||= error.statusMessage;
|
|
delete defaultRes.headers["content-type"];
|
|
delete defaultRes.headers["content-security-policy"];
|
|
setResponseHeaders(event, defaultRes.headers);
|
|
const reqHeaders = getRequestHeaders(event);
|
|
const isRenderingError = event.path.startsWith("/__nuxt_error") || !!reqHeaders["x-nuxt-error"];
|
|
const res = isRenderingError ? null : await useNitroApp().localFetch(
|
|
withQuery(joinURL$5(useRuntimeConfig(event).app.baseURL, "/__nuxt_error"), errorObject),
|
|
{
|
|
headers: { ...reqHeaders, "x-nuxt-error": "true" },
|
|
redirect: "manual"
|
|
}
|
|
).catch(() => null);
|
|
if (event.handled) {
|
|
return;
|
|
}
|
|
if (!res) {
|
|
const { template } = await Promise.resolve().then(function () { return error500; });
|
|
{
|
|
errorObject.description = errorObject.message;
|
|
}
|
|
setResponseHeader(event, "Content-Type", "text/html;charset=UTF-8");
|
|
return send(event, template(errorObject));
|
|
}
|
|
const html = await res.text();
|
|
for (const [header, value] of res.headers.entries()) {
|
|
if (header === "set-cookie") {
|
|
appendResponseHeader(event, header, value);
|
|
continue;
|
|
}
|
|
setResponseHeader(event, header, value);
|
|
}
|
|
setResponseStatus(event, res.status && res.status !== 200 ? res.status : defaultRes.status, res.statusText || defaultRes.statusText);
|
|
if (!globalThis._importMeta_.test && typeof html === "string") {
|
|
const prettyResponse = await defaultHandler(error, event, { json: false });
|
|
return send(event, html.replace("</body>", `${generateErrorOverlayHTML(prettyResponse.body, { startMinimized: 300 <= statusCode && statusCode < 500 })}</body>`));
|
|
}
|
|
return send(event, html);
|
|
});
|
|
|
|
function defineNitroErrorHandler(handler) {
|
|
return handler;
|
|
}
|
|
|
|
const errorHandler$1 = defineNitroErrorHandler(
|
|
async function defaultNitroErrorHandler(error, event) {
|
|
const res = await defaultHandler(error, event);
|
|
if (!event.node?.res.headersSent) {
|
|
setResponseHeaders(event, res.headers);
|
|
}
|
|
setResponseStatus(event, res.status, res.statusText);
|
|
return send(
|
|
event,
|
|
typeof res.body === "string" ? res.body : JSON.stringify(res.body, null, 2)
|
|
);
|
|
}
|
|
);
|
|
async function defaultHandler(error, event, opts) {
|
|
const isSensitive = error.unhandled || error.fatal;
|
|
const statusCode = error.statusCode || 500;
|
|
const statusMessage = error.statusMessage || "Server Error";
|
|
const url = getRequestURL(event, { xForwardedHost: true, xForwardedProto: true });
|
|
if (statusCode === 404) {
|
|
const baseURL = "/";
|
|
if (/^\/[^/]/.test(baseURL) && !url.pathname.startsWith(baseURL)) {
|
|
const redirectTo = `${baseURL}${url.pathname.slice(1)}${url.search}`;
|
|
return {
|
|
status: 302,
|
|
statusText: "Found",
|
|
headers: { location: redirectTo },
|
|
body: `Redirecting...`
|
|
};
|
|
}
|
|
}
|
|
await loadStackTrace(error).catch(consola.error);
|
|
const youch = new Youch();
|
|
if (isSensitive && !opts?.silent) {
|
|
const tags = [error.unhandled && "[unhandled]", error.fatal && "[fatal]"].filter(Boolean).join(" ");
|
|
const ansiError = await (await youch.toANSI(error)).replaceAll(process.cwd(), ".");
|
|
consola.error(
|
|
`[request error] ${tags} [${event.method}] ${url}
|
|
|
|
`,
|
|
ansiError
|
|
);
|
|
}
|
|
const useJSON = opts?.json || !getRequestHeader(event, "accept")?.includes("text/html");
|
|
const headers = {
|
|
"content-type": useJSON ? "application/json" : "text/html",
|
|
// Prevent browser from guessing the MIME types of resources.
|
|
"x-content-type-options": "nosniff",
|
|
// Prevent error page from being embedded in an iframe
|
|
"x-frame-options": "DENY",
|
|
// Prevent browsers from sending the Referer header
|
|
"referrer-policy": "no-referrer",
|
|
// Disable the execution of any js
|
|
"content-security-policy": "script-src 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self';"
|
|
};
|
|
if (statusCode === 404 || !getResponseHeader(event, "cache-control")) {
|
|
headers["cache-control"] = "no-cache";
|
|
}
|
|
const body = useJSON ? {
|
|
error: true,
|
|
url,
|
|
statusCode,
|
|
statusMessage,
|
|
message: error.message,
|
|
data: error.data,
|
|
stack: error.stack?.split("\n").map((line) => line.trim())
|
|
} : await youch.toHTML(error, {
|
|
request: {
|
|
url: url.href,
|
|
method: event.method,
|
|
headers: getRequestHeaders(event)
|
|
}
|
|
});
|
|
return {
|
|
status: statusCode,
|
|
statusText: statusMessage,
|
|
headers,
|
|
body
|
|
};
|
|
}
|
|
async function loadStackTrace(error) {
|
|
if (!(error instanceof Error)) {
|
|
return;
|
|
}
|
|
const parsed = await new ErrorParser().defineSourceLoader(sourceLoader).parse(error);
|
|
const stack = error.message + "\n" + parsed.frames.map((frame) => fmtFrame(frame)).join("\n");
|
|
Object.defineProperty(error, "stack", { value: stack });
|
|
if (error.cause) {
|
|
await loadStackTrace(error.cause).catch(consola.error);
|
|
}
|
|
}
|
|
async function sourceLoader(frame) {
|
|
if (!frame.fileName || frame.fileType !== "fs" || frame.type === "native") {
|
|
return;
|
|
}
|
|
if (frame.type === "app") {
|
|
const rawSourceMap = await readFile(`${frame.fileName}.map`, "utf8").catch(() => {
|
|
});
|
|
if (rawSourceMap) {
|
|
const consumer = await new SourceMapConsumer(rawSourceMap);
|
|
const originalPosition = consumer.originalPositionFor({ line: frame.lineNumber, column: frame.columnNumber });
|
|
if (originalPosition.source && originalPosition.line) {
|
|
frame.fileName = resolve(dirname(frame.fileName), originalPosition.source);
|
|
frame.lineNumber = originalPosition.line;
|
|
frame.columnNumber = originalPosition.column || 0;
|
|
}
|
|
}
|
|
}
|
|
const contents = await readFile(frame.fileName, "utf8").catch(() => {
|
|
});
|
|
return contents ? { contents } : void 0;
|
|
}
|
|
function fmtFrame(frame) {
|
|
if (frame.type === "native") {
|
|
return frame.raw;
|
|
}
|
|
const src = `${frame.fileName || ""}:${frame.lineNumber}:${frame.columnNumber})`;
|
|
return frame.functionName ? `at ${frame.functionName} (${src}` : `at ${src}`;
|
|
}
|
|
|
|
const errorHandlers = [errorHandler$0, errorHandler$1];
|
|
|
|
async function errorHandler(error, event) {
|
|
for (const handler of errorHandlers) {
|
|
try {
|
|
await handler(error, event, { defaultHandler });
|
|
if (event.handled) {
|
|
return; // Response handled
|
|
}
|
|
} catch(error) {
|
|
// Handler itself thrown, log and continue
|
|
console.error(error);
|
|
}
|
|
}
|
|
// H3 will handle fallback
|
|
}
|
|
|
|
const script = `
|
|
if (!window.__NUXT_DEVTOOLS_TIME_METRIC__) {
|
|
Object.defineProperty(window, '__NUXT_DEVTOOLS_TIME_METRIC__', {
|
|
value: {},
|
|
enumerable: false,
|
|
configurable: true,
|
|
})
|
|
}
|
|
window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
|
|
`;
|
|
|
|
const _DJKGAv2iMHVPxZkin17vYuo6inB2bhCUpVD7WRNHPvs = (function(nitro) {
|
|
nitro.hooks.hook("render:html", (htmlContext) => {
|
|
htmlContext.head.push(`<script>${script}<\/script>`);
|
|
});
|
|
});
|
|
|
|
/*!
|
|
* shared v11.3.0
|
|
* (c) 2026 kazuya kawaguchi
|
|
* Released under the MIT License.
|
|
*/
|
|
const _create = Object.create;
|
|
const create = (obj = null) => _create(obj);
|
|
/* eslint-enable */
|
|
/**
|
|
* Useful Utilities By Evan you
|
|
* Modified by kazuya kawaguchi
|
|
* MIT License
|
|
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts
|
|
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts
|
|
*/
|
|
const isArray = Array.isArray;
|
|
const isFunction = (val) => typeof val === 'function';
|
|
const isString = (val) => typeof val === 'string';
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
const isObject = (val) => val !== null && typeof val === 'object';
|
|
const objectToString = Object.prototype.toString;
|
|
const toTypeString = (value) => objectToString.call(value);
|
|
|
|
const isNotObjectOrIsArray = (val) => !isObject(val) || isArray(val);
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
function deepCopy(src, des) {
|
|
// src and des should both be objects, and none of them can be a array
|
|
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
|
|
throw new Error('Invalid value');
|
|
}
|
|
const stack = [{ src, des }];
|
|
while (stack.length) {
|
|
const { src, des } = stack.pop();
|
|
// using `Object.keys` which skips prototype properties
|
|
Object.keys(src).forEach(key => {
|
|
if (key === '__proto__') {
|
|
return;
|
|
}
|
|
// if src[key] is an object/array, set des[key]
|
|
// to empty object/array to prevent setting by reference
|
|
if (isObject(src[key]) && !isObject(des[key])) {
|
|
des[key] = Array.isArray(src[key]) ? [] : create();
|
|
}
|
|
if (isNotObjectOrIsArray(des[key]) || isNotObjectOrIsArray(src[key])) {
|
|
// replace with src[key] when:
|
|
// src[key] or des[key] is not an object, or
|
|
// src[key] or des[key] is an array
|
|
des[key] = src[key];
|
|
}
|
|
else {
|
|
// src[key] and des[key] are both objects, merge them
|
|
stack.push({ src: src[key], des: des[key] });
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
const __nuxtMock = { runWithContext: async (fn) => await fn() };
|
|
const merger = createDefu((obj, key, value) => {
|
|
if (key === "messages" || key === "datetimeFormats" || key === "numberFormats") {
|
|
obj[key] ??= create(null);
|
|
deepCopy(value, obj[key]);
|
|
return true;
|
|
}
|
|
});
|
|
async function loadVueI18nOptions(vueI18nConfigs) {
|
|
const nuxtApp = __nuxtMock;
|
|
let vueI18nOptions = { messages: create(null) };
|
|
for (const configFile of vueI18nConfigs) {
|
|
const resolver = await configFile().then((x) => isModule(x) ? x.default : x);
|
|
const resolved = isFunction(resolver) ? await nuxtApp.runWithContext(() => resolver()) : resolver;
|
|
vueI18nOptions = merger(create(null), resolved, vueI18nOptions);
|
|
}
|
|
vueI18nOptions.fallbackLocale ??= false;
|
|
return vueI18nOptions;
|
|
}
|
|
const isModule = (val) => toTypeString(val) === "[object Module]";
|
|
async function getLocaleMessages(locale, loader) {
|
|
const nuxtApp = __nuxtMock;
|
|
try {
|
|
const getter = await nuxtApp.runWithContext(loader.load).then((x) => isModule(x) ? x.default : x);
|
|
return isFunction(getter) ? await nuxtApp.runWithContext(() => getter(locale)) : getter;
|
|
} catch (e) {
|
|
throw new Error(`Failed loading locale (${locale}): ` + e.message);
|
|
}
|
|
}
|
|
async function getLocaleMessagesMerged(locale, loaders = []) {
|
|
const nuxtApp = __nuxtMock;
|
|
const messages = await Promise.all(
|
|
loaders.map((loader) => nuxtApp.runWithContext(() => getLocaleMessages(locale, loader)))
|
|
);
|
|
const merged = {};
|
|
for (const message of messages) {
|
|
deepCopy(message, merged);
|
|
}
|
|
return merged;
|
|
}
|
|
|
|
const locale_zh_45CN_46ts_03fdcfef = {
|
|
// 通用
|
|
common: {
|
|
loading: "\u52A0\u8F7D\u4E2D...",
|
|
confirm: "\u786E\u8BA4",
|
|
cancel: "\u53D6\u6D88",
|
|
save: "\u4FDD\u5B58",
|
|
delete: "\u5220\u9664",
|
|
edit: "\u7F16\u8F91",
|
|
add: "\u6DFB\u52A0",
|
|
search: "\u641C\u7D22",
|
|
reset: "\u91CD\u7F6E",
|
|
submit: "\u63D0\u4EA4",
|
|
back: "\u8FD4\u56DE",
|
|
next: "\u4E0B\u4E00\u6B65",
|
|
prev: "\u4E0A\u4E00\u6B65",
|
|
success: "\u6210\u529F",
|
|
error: "\u5931\u8D25",
|
|
warning: "\u8B66\u544A",
|
|
info: "\u63D0\u793A",
|
|
yes: "\u662F",
|
|
no: "\u5426",
|
|
and: "\u548C",
|
|
required: "\u5FC5\u586B",
|
|
optional: "\u9009\u586B",
|
|
all: "\u5168\u90E8",
|
|
noData: "\u6682\u65E0\u6570\u636E",
|
|
viewMore: "\u67E5\u770B\u66F4\u591A",
|
|
viewAll: "\u67E5\u770B\u5168\u90E8",
|
|
contact: "\u8054\u7CFB\u6211\u4EEC",
|
|
learnMore: "\u4E86\u89E3\u66F4\u591A",
|
|
goNow: "\u7ACB\u5373\u524D\u5F80",
|
|
tryNow: "\u7ACB\u5373\u4F53\u9A8C",
|
|
processing: "\u5904\u7406\u4E2D...",
|
|
devEnv: "\u5F00\u53D1\u73AF\u5883",
|
|
prodEnv: "\u751F\u4EA7\u73AF\u5883"
|
|
},
|
|
// 首页
|
|
home: {
|
|
// Hero 区域
|
|
heroTag: "OpenClaw \u5B98\u65B9\u5408\u4F5C\u5E73\u53F0",
|
|
heroTitle: "AI-Native \u5E94\u7528\u5F00\u53D1\u5E73\u53F0\uFF1A\u96C6\u6210 OpenClaw \u751F\u6001\u7684\u4E0B\u4E00\u4EE3 AI \u667A\u80FD\u4F53\u5E73\u53F0",
|
|
heroDesc: '\u9762\u5411 AI \u65F6\u4EE3\u7684\u5B98\u7F51\u3001\u7535\u5546\u3001\u5C0F\u7A0B\u5E8F\u7B49\u4E1A\u52A1\u573A\u666F\uFF0C\u6DF1\u5EA6\u96C6\u6210 OpenClaw \u5F00\u6E90 AI Agent \u6846\u67B6\uFF1B\u5185\u7F6E AI \u667A\u80FD\u4F53\u5F15\u64CE\uFF0C\u652F\u6301\u77E5\u8BC6\u5E93\u95EE\u7B54\u3001\u667A\u80FD\u5BA2\u670D\u3001\u5185\u5BB9\u751F\u6210\u3001\u81EA\u52A8\u5316\u5DE5\u4F5C\u6D41\u4E0E\u591A\u5E73\u53F0\u63A5\u5165\u3002\u5BA2\u6237\u4E0B\u5355\u540E\u81EA\u52A8\u521B\u5EFA\u79DF\u6237\u3001\u521D\u59CB\u5316\u6A21\u5757\u4E0E\u57FA\u7840\u6570\u636E\uFF0C\u5B9E\u73B0"\u652F\u4ED8\u5373\u5F00\u901A\uFF0C\u5F00\u7BB1\u5373\u7528 AI"\u3002',
|
|
bookDemo: "\u9884\u7EA6\u6F14\u793A",
|
|
viewFlow: "\u67E5\u770B\u5F00\u901A\u6D41\u7A0B",
|
|
deploy: "\u79C1\u6709\u5316\u90E8\u7F72",
|
|
// OpenClaw 生态
|
|
openclawTitle: "\u6DF1\u5EA6\u96C6\u6210 OpenClaw \u5F00\u6E90\u6846\u67B6",
|
|
openclawSubtitle: "AI \u667A\u80FD\u4F53\u751F\u6001",
|
|
openclawDesc: '\u6E90\u81EA MIT \u5F00\u6E90\u534F\u8BAE\uFF0C315K+ GitHub \u661F\u6807\u8BA4\u8BC1\uFF0C\u8BA9 AI \u62E5\u6709"\u53CC\u624B"\u6267\u884C\u590D\u6742\u4EFB\u52A1',
|
|
// AI 能力卡片
|
|
multiPlatform: "\u591A\u5E73\u53F0\u65E0\u611F\u63A5\u5165",
|
|
multiPlatformDesc: "\u652F\u6301 WhatsApp\u3001Telegram\u3001Discord\u3001\u98DE\u4E66\u3001\u5FAE\u4FE1\u7B49 20+ \u901A\u8BAF\u5E73\u53F0\uFF0C\u4E00\u4E2A AI \u540C\u65F6\u670D\u52A1\u591A\u6E20\u9053",
|
|
multiModel: "\u591A\u6A21\u578B\u7075\u6D3B\u5207\u6362",
|
|
multiModelDesc: "\u652F\u6301 Claude\u3001GPT\u3001DeepSeek\u3001Ollama \u7B49 25+ \u5927\u6A21\u578B\uFF0C\u672C\u5730\u90E8\u7F72\u4FDD\u62A4\u6570\u636E\u9690\u79C1",
|
|
autoWorkflow: "\u81EA\u52A8\u5316\u5DE5\u4F5C\u6D41",
|
|
autoWorkflowDesc: '\u5B9A\u65F6\u4EFB\u52A1\u3001\u6280\u80FD\u7CFB\u7EDF\u3001MCP \u5DE5\u5177\u6269\u5C55\uFF0C\u8BA9 AI \u4ECE"\u80FD\u8BF4"\u5347\u7EA7\u4E3A"\u80FD\u505A"',
|
|
experienceAI: "\u4F53\u9A8C AI \u667A\u80FD\u4F53",
|
|
// 产品矩阵
|
|
productMatrix: "\u4EA7\u54C1\u77E9\u9635",
|
|
productMatrixDesc: "\u9762\u5411\u4E0D\u540C\u4E1A\u52A1\u573A\u666F\u7684\u53EF\u552E\u5356\u4EA7\u54C1\uFF0C\u652F\u6301\u5957\u9910\u5316\u552E\u5356\u3001\u652F\u4ED8\u5373\u5F00\u901A\u3001\u6A21\u677F/\u63D2\u4EF6\u52A0\u8D2D\u4E0E\u79C1\u6709\u5316\u4EA4\u4ED8\u3002",
|
|
recommend: "\u63A8\u8350",
|
|
// 核心能力
|
|
coreCapabilities: "\u6838\u5FC3\u80FD\u529B",
|
|
coreCapabilitiesDesc: "\u7528\u4E00\u5957\u5E73\u53F0\u80FD\u529B\uFF0C\u8986\u76D6\u4EA7\u54C1\u552E\u5356\u3001\u4EA4\u4ED8\u5F00\u901A\u3001\u8FD0\u8425\u5347\u7EA7\u4E0E\u751F\u6001\u53D8\u73B0\u3002",
|
|
// OpenClaw AI 智能体
|
|
openclawAI: "OpenClaw AI \u667A\u80FD\u4F53",
|
|
openclawAIDesc: "\u6DF1\u5EA6\u96C6\u6210 OpenClaw \u5F00\u6E90\u6846\u67B6\uFF0C\u652F\u6301 20+ \u5E73\u53F0\u63A5\u5165\u300125+ \u6A21\u578B\u5207\u6362\uFF0C\u8BA9 AI \u771F\u6B63\u6267\u884C\u4EFB\u52A1\u3002",
|
|
// RAG 知识库
|
|
ragKnowledge: "RAG \u77E5\u8BC6\u5E93",
|
|
ragKnowledgeDesc: "\u4F01\u4E1A\u7EA7 RAG \u65B9\u6848\uFF0C\u652F\u6301\u6587\u6863\u89E3\u6790\u3001\u5411\u91CF\u5316\u5B58\u50A8\u3001\u667A\u80FD\u68C0\u7D22\u4E0E\u95EE\u7B54\uFF0C\u5927\u5E45\u63D0\u5347 AI \u56DE\u590D\u8D28\u91CF\u3002",
|
|
// SaaS 多租户
|
|
saasMultiTenant: "SaaS \u591A\u79DF\u6237\u5E73\u53F0",
|
|
saasMultiTenantDesc: "\u79DF\u6237\u9694\u79BB\u3001\u7EC4\u7EC7\u4E0E\u6743\u9650\u4F53\u7CFB\u3001\u914D\u7F6E\u4E2D\u5FC3\u4E0E\u5BA1\u8BA1\u80FD\u529B\uFF0C\u4E3A\u591A\u4E1A\u52A1\u7EBF\u7EDF\u4E00\u5E95\u5EA7\u3002",
|
|
// 私有化部署
|
|
privateDeploy: "\u79C1\u6709\u5316\u90E8\u7F72",
|
|
privateDeployDesc: "\u652F\u6301\u672C\u5730/\u4E13\u6709\u4E91\u90E8\u7F72\uFF0C\u63D0\u4F9B\u90E8\u7F72\u6587\u6863\u3001\u9A8C\u6536\u6E05\u5355\u4E0E\u5347\u7EA7\u7B56\u7565\uFF0C\u6EE1\u8DB3\u5B89\u5168\u5408\u89C4\u3002",
|
|
// 模板市场
|
|
templateMarket: "\u6A21\u677F\u5E02\u573A",
|
|
templateMarketDesc: "\u884C\u4E1A\u6A21\u677F\u4E00\u952E\u5957\u7528\uFF0C\u9ED8\u8BA4\u914D\u7F6E\u4E0E\u521D\u59CB\u5316\u811A\u672C\u914D\u5957\uFF0C\u4EA4\u4ED8\u66F4\u6807\u51C6\u3001\u4E0A\u7EBF\u66F4\u5FEB\u3002",
|
|
// 自动开通
|
|
autoActivate: "\u81EA\u52A8\u5F00\u901A\u94FE\u8DEF",
|
|
autoActivateDesc: "\u9009\u54C1\u652F\u4ED8\u540E\u81EA\u52A8\u521B\u5EFA\u79DF\u6237\u3001\u521D\u59CB\u5316\u6A21\u5757/\u83DC\u5355/\u57FA\u7840\u6570\u636E\uFF0C\u5E76\u4EA4\u4ED8\u8BBF\u95EE\u5165\u53E3\u3002",
|
|
// 支付即开通
|
|
payToActivate: "\u652F\u4ED8\u5373\u5F00\u901A",
|
|
payToActivateDesc: "\u5BA2\u6237\u9009\u62E9\u4EA7\u54C1\u5E76\u652F\u4ED8\u540E\uFF0C\u5E73\u53F0\u81EA\u52A8\u5B8C\u6210\uFF1A\u521B\u5EFA\u79DF\u6237\u3001\u521D\u59CB\u5316\u6A21\u5757\u3001\u5199\u5165\u9ED8\u8BA4\u914D\u7F6E\u4E0E\u57FA\u7840\u6570\u636E\u3001\u751F\u6210\u7BA1\u7406\u5458\u8D26\u53F7\u5E76\u4EA4\u4ED8\u8BBF\u95EE\u5165\u53E3\u3002",
|
|
viewFullFlow: "\u67E5\u770B\u5168\u6D41\u7A0B",
|
|
// 开通流程步骤
|
|
selectProduct: "\u9009\u62E9\u4EA7\u54C1/\u5957\u9910",
|
|
selectProductDesc: "\u652F\u6301\u4EA7\u54C1\u77E9\u9635\u3001\u6A21\u677F/\u63D2\u4EF6\u52A0\u8D2D\u3001\u589E\u503C\u9879",
|
|
placeOrder: "\u4E0B\u5355\u652F\u4ED8",
|
|
placeOrderDesc: "\u652F\u4ED8\u6210\u529F\u89E6\u53D1\u5F00\u901A\u4EFB\u52A1\u7F16\u6392",
|
|
createTenant: "\u521B\u5EFA\u79DF\u6237",
|
|
createTenantDesc: "\u79DF\u6237\u9694\u79BB\u3001\u57DF\u540D/\u5E94\u7528\u4FE1\u606F\u7ED1\u5B9A\u3001\u7BA1\u7406\u5458\u751F\u6210",
|
|
initModules: "\u6A21\u5757\u521D\u59CB\u5316",
|
|
initModulesDesc: "\u6309\u6240\u8D2D\u4EA7\u54C1\u52A0\u8F7D\u6A21\u5757\u4E0E\u83DC\u5355\u6743\u9650\uFF0C\u5199\u5165\u57FA\u7840\u6570\u636E/\u793A\u4F8B\u6570\u636E",
|
|
deliverOnline: "\u4EA4\u4ED8\u4E0A\u7EBF",
|
|
deliverOnlineDesc: "SaaS \u76F4\u63A5\u53EF\u7528\uFF1B\u79C1\u6709\u5316\u4EA4\u4ED8\u955C\u50CF/\u90E8\u7F72\u6587\u6863/\u9A8C\u6536\u6E05\u5355",
|
|
// 模板与插件
|
|
templatePluginEcosystem: "\u6A21\u677F\u4E0E\u63D2\u4EF6\u751F\u6001",
|
|
templatePluginDesc: "\u901A\u8FC7\u6A21\u677F\u52A0\u901F\u4EA4\u4ED8\uFF0C\u901A\u8FC7\u63D2\u4EF6\u6269\u5C55\u80FD\u529B\uFF1B\u652F\u6301\u8D2D\u4E70\u3001\u6388\u6743\u3001\u66F4\u65B0\u4E0E\u7248\u672C\u7BA1\u7406\u3002",
|
|
template: "\u6A21\u677F",
|
|
plugin: "\u63D2\u4EF6",
|
|
industryTemplate: "\u884C\u4E1A\u6A21\u677F",
|
|
industryTemplateDesc: "\u6309\u884C\u4E1A/\u573A\u666F\u63D0\u4F9B\u6210\u5957\u9875\u9762\u4E0E\u914D\u7F6E\uFF0C\u652F\u6301\u4E00\u952E\u5957\u7528\u3001\u4E8C\u6B21\u7F16\u8F91\u4E0E\u591A\u7248\u672C\u7BA1\u7406\u3002",
|
|
deliveryStandard: "\u4EA4\u4ED8\u6807\u51C6\u5316",
|
|
deliveryStandardDesc: '\u6A21\u677F\u4E0E\u521D\u59CB\u5316\u811A\u672C\u914D\u5957\uFF0C\u8BA9"\u5F00\u901A\u540E\u7684\u9ED8\u8BA4\u7AD9\u70B9"\u53EF\u76F4\u63A5\u9A8C\u6536\u3002',
|
|
capabilityExtend: "\u80FD\u529B\u6269\u5C55",
|
|
capabilityExtendDesc: "\u652F\u4ED8\u3001\u4F1A\u5458\u3001\u8425\u9500\u3001\u5DE5\u5355\u3001\u6570\u636E\u7EDF\u8BA1\u7B49\u80FD\u529B\u6309\u9700\u52A0\u8D2D\uFF0C\u968F\u4E70\u968F\u7528\u3002",
|
|
upgradeAuth: "\u5347\u7EA7\u4E0E\u6388\u6743",
|
|
upgradeAuthDesc: "\u652F\u6301\u7248\u672C\u5347\u7EA7\u3001\u6388\u6743\u6821\u9A8C\u3001\u5230\u671F\u7EED\u8D39\u4E0E\u7070\u5EA6\u53D1\u5E03\u3002",
|
|
exploreMarket: "\u4E86\u89E3\u6A21\u677F/\u63D2\u4EF6\u5E02\u573A",
|
|
// CTA
|
|
ctaTitle: "\u60F3\u5FEB\u901F\u642D\u5EFA\u5E76\u4EA4\u4ED8\u4E00\u4E2A\u53EF\u8FD0\u8425\u7684\u4EA7\u54C1\uFF1F",
|
|
ctaDesc: "\u9884\u7EA6\u6F14\u793A\uFF0C\u6211\u4EEC\u5C06\u6309\u4F60\u7684\u4E1A\u52A1\u573A\u666F\u7ED9\u51FA\u65B9\u6848\u4E0E\u62A5\u4EF7\u3002",
|
|
viewProducts: "\u770B\u4EA7\u54C1\u77E9\u9635",
|
|
contactNow: "\u9A6C\u4E0A\u8054\u7CFB",
|
|
// 视频
|
|
videoNotSupported: "\u60A8\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u89C6\u9891\u64AD\u653E"
|
|
},
|
|
// 登录页
|
|
login: {
|
|
// 左侧品牌区
|
|
aiPlatform: "AI \u539F\u751F\u5F00\u53D1\u5E73\u53F0",
|
|
buildNextGen: "\u6784\u5EFA\u4E0B\u4E00\u4EE3\nAI \u5E94\u7528",
|
|
lowcodeAccess: "\u4F4E\u4EE3\u7801\u63A5\u5165 \xB7 \u591A\u6A21\u578B\u8C03\u5EA6 \xB7 \u667A\u80FD\u4F53\u5DE5\u4F5C\u6D41",
|
|
fromIdeaToOnline: "\u4ECE Idea \u5230\u4E0A\u7EBF\uFF0C\u5168\u7A0B\u63D0\u6548",
|
|
developers: "\u5F00\u53D1\u8005",
|
|
aiApps: "AI \u5E94\u7528",
|
|
uptime: "\u53EF\u7528\u7387",
|
|
copyright: "\xA9 2025 Websopy \xB7 \u5B89\u5168 \xB7 \u7A33\u5B9A \xB7 \u9AD8\u6548",
|
|
// 右侧表单
|
|
aiAppPlatform: "AI \u5E94\u7528\u5E73\u53F0",
|
|
// 扫码登录
|
|
scanLogin: "\u626B\u7801\u767B\u5F55",
|
|
scanLoginDesc: "\u4F7F\u7528 App \u626B\u63CF\u4E8C\u7EF4\u7801\u5FEB\u901F\u767B\u5F55",
|
|
// 欢迎回来
|
|
welcomeBack: "\u6B22\u8FCE\u56DE\u6765",
|
|
loginToContinue: "\u8BF7\u767B\u5F55\u60A8\u7684\u8D26\u53F7\u4EE5\u7EE7\u7EED",
|
|
// 登录方式
|
|
phoneLogin: "\u624B\u673A\u53F7\u767B\u5F55",
|
|
accountLogin: "\u8D26\u53F7\u767B\u5F55",
|
|
// 输入提示
|
|
accountPlaceholder: "\u8D26\u53F7 / \u7528\u6237ID",
|
|
passwordPlaceholder: "\u767B\u5F55\u5BC6\u7801",
|
|
captchaPlaceholder: "\u56FE\u5F62\u9A8C\u8BC1\u7801",
|
|
phonePlaceholder: "\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801",
|
|
smsCodePlaceholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
// 操作
|
|
rememberLogin: "\u8BB0\u4F4F\u767B\u5F55",
|
|
clickRefresh: "\u70B9\u51FB\u5237\u65B0",
|
|
clickGet: "\u70B9\u51FB\u83B7\u53D6",
|
|
sendCode: "\u53D1\u9001\u9A8C\u8BC1\u7801",
|
|
resendAfter: "s \u540E\u91CD\u53D1",
|
|
loginNow: "\u7ACB\u5373\u767B\u5F55",
|
|
loggingIn: "\u767B\u5F55\u4E2D\u2026",
|
|
// 协议
|
|
agreeTerms: "\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F",
|
|
registerAgreement: "\u300A\u6CE8\u518C\u534F\u8BAE\u300B",
|
|
privacyPolicy: "\u300A\u9690\u79C1\u653F\u7B56\u300B",
|
|
agreeRequired: "\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u300A\u6CE8\u518C\u534F\u8BAE\u300B\u548C\u300A\u9690\u79C1\u653F\u7B56\u300B",
|
|
// 切换
|
|
switchToPhone: "\u5207\u6362\u5230\u624B\u673A\u53F7\u767B\u5F55",
|
|
switchToScan: "\u626B\u7801\u767B\u5F55",
|
|
// 安全验证弹窗
|
|
securityVerify: "\u5B89\u5168\u9A8C\u8BC1",
|
|
completeVerifyFirst: "\u8BF7\u5148\u5B8C\u6210\u56FE\u5F62\u9A8C\u8BC1\u7801\u9A8C\u8BC1",
|
|
enterImgCode: "\u8BF7\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801",
|
|
imgCodeIncorrect: "\u56FE\u5F62\u9A8C\u8BC1\u7801\u4E0D\u6B63\u786E",
|
|
// 选择账号
|
|
selectAccount: "\u9009\u62E9\u8D26\u53F7\u767B\u5F55",
|
|
tenantId: "\u79DF\u6237ID",
|
|
// 错误提示
|
|
enterAccount: "\u8BF7\u8F93\u5165\u8D26\u53F7",
|
|
enterPassword: "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
enterCaptcha: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
enterPhone: "\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801",
|
|
phoneFormatError: "\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E",
|
|
enterSmsCode: "\u8BF7\u8F93\u5165\u77ED\u4FE1\u9A8C\u8BC1\u7801",
|
|
// 消息
|
|
smsSentSuccess: "\u77ED\u4FE1\u9A8C\u8BC1\u7801\u53D1\u9001\u6210\u529F\uFF0C\u8BF7\u6CE8\u610F\u67E5\u6536",
|
|
sendFailed: "\u53D1\u9001\u5931\u8D25",
|
|
loginSuccess: "\u767B\u5F55\u6210\u529F",
|
|
loginFailed: "\u767B\u5F55\u5931\u8D25",
|
|
scanLoginSuccess: "\u626B\u7801\u767B\u5F55\u6210\u529F",
|
|
scanLoginFailed: "\u626B\u7801\u767B\u5F55\u5931\u8D25"
|
|
},
|
|
// 导航
|
|
nav: {
|
|
home: "\u9996\u9875",
|
|
products: "\u4EA7\u54C1",
|
|
pricing: "\u4EF7\u683C",
|
|
docs: "\u6587\u6863",
|
|
blog: "\u535A\u5BA2",
|
|
about: "\u5173\u4E8E\u6211\u4EEC",
|
|
contact: "\u8054\u7CFB\u6211\u4EEC",
|
|
login: "\u767B\u5F55",
|
|
register: "\u6CE8\u518C",
|
|
dashboard: "\u63A7\u5236\u53F0",
|
|
userCenter: "\u8D26\u6237\u4FE1\u606F",
|
|
logout: "\u9000\u51FA\u767B\u5F55",
|
|
language: "\u8BED\u8A00",
|
|
navigation: "\u5BFC\u822A",
|
|
orders: "\u6211\u7684\u8BA2\u5355",
|
|
developer: "\u5F00\u53D1\u8005\u4E2D\u5FC3",
|
|
admin: "\u5E73\u53F0\u7BA1\u7406"
|
|
},
|
|
// 开发者中心
|
|
developer: {
|
|
title: "\u5F00\u53D1\u8005\u4E2D\u5FC3",
|
|
overview: "\u6982\u89C8",
|
|
myApps: "\u6211\u7684\u5E94\u7528",
|
|
resources: "\u8D44\u6E90\u7BA1\u7406",
|
|
git: "Git \u7ED1\u5B9A",
|
|
permissionRequests: "\u6743\u9650\u7533\u8BF7",
|
|
apiDocs: "API \u6587\u6863",
|
|
settings: "\u8BBE\u7F6E"
|
|
},
|
|
// 资源中心
|
|
resources: {
|
|
title: "\u8D44\u6E90\u4E2D\u5FC3",
|
|
servers: "\u670D\u52A1\u5668",
|
|
databases: "\u6570\u636E\u5E93",
|
|
storage: "\u5B58\u50A8",
|
|
domains: "\u57DF\u540D",
|
|
ssl: "SSL\u8BC1\u4E66",
|
|
addResource: "\u6DFB\u52A0\u8D44\u6E90",
|
|
resourceType: "\u8D44\u6E90\u7C7B\u578B",
|
|
resourceName: "\u8D44\u6E90\u540D\u79F0",
|
|
status: "\u72B6\u6001",
|
|
createTime: "\u521B\u5EFA\u65F6\u95F4",
|
|
expireTime: "\u8FC7\u671F\u65F6\u95F4",
|
|
actions: "\u64CD\u4F5C",
|
|
active: "\u8FD0\u884C\u4E2D",
|
|
stopped: "\u5DF2\u505C\u6B62",
|
|
expired: "\u5DF2\u8FC7\u671F"
|
|
},
|
|
// 权限申请
|
|
permission: {
|
|
title: "\u6743\u9650\u7533\u8BF7",
|
|
applyNew: "\u7533\u8BF7\u65B0\u6743\u9650",
|
|
myRequests: "\u6211\u7684\u7533\u8BF7",
|
|
repository: "\u4ED3\u5E93",
|
|
permission: "\u6743\u9650",
|
|
status: "\u72B6\u6001",
|
|
applyTime: "\u7533\u8BF7\u65F6\u95F4",
|
|
pending: "\u5F85\u5BA1\u6838",
|
|
approved: "\u5DF2\u901A\u8FC7",
|
|
rejected: "\u5DF2\u62D2\u7EDD",
|
|
applyReason: "\u7533\u8BF7\u7406\u7531",
|
|
submit: "\u63D0\u4EA4\u7533\u8BF7"
|
|
},
|
|
// 页面标题
|
|
pageTitle: {
|
|
// 首页 SEO
|
|
homeTitle: "AI-Native \u5E94\u7528\u5F00\u53D1\u5E73\u53F0 - \u96C6\u6210 OpenClaw \u751F\u6001\u7684\u4E0B\u4E00\u4EE3 AI \u667A\u80FD\u4F53\u5E73\u53F0",
|
|
homeDescription: "\u6DF1\u5EA6\u96C6\u6210 OpenClaw \u5F00\u6E90\u6846\u67B6 (315K+ GitHub Stars)\uFF0C\u63D0\u4F9B SaaS \u591A\u79DF\u6237\u3001AI \u667A\u80FD\u4F53\u3001RAG \u77E5\u8BC6\u5E93\u4E0E\u79C1\u6709\u5316\u90E8\u7F72\u80FD\u529B\u3002\u652F\u6301 20+ \u5E73\u53F0\u63A5\u5165\u300125+ \u6A21\u578B\u5207\u6362\uFF0C\u8BA9 AI \u771F\u6B63\u6267\u884C\u590D\u6742\u4EFB\u52A1\u3002",
|
|
// 登录
|
|
loginTitle: "\u767B\u5F55",
|
|
// 开发者中心
|
|
developerCenter: "\u5F00\u53D1\u8005\u4E2D\u5FC3",
|
|
// 资源管理
|
|
resourceCenter: "\u8D44\u6E90\u4E2D\u5FC3",
|
|
// 权限申请
|
|
permissionRequest: "\u6743\u9650\u7533\u8BF7"
|
|
}
|
|
};
|
|
|
|
const locale_en_46ts_f974ebc9 = {
|
|
// Common
|
|
common: {
|
|
loading: "Loading...",
|
|
confirm: "Confirm",
|
|
cancel: "Cancel",
|
|
save: "Save",
|
|
delete: "Delete",
|
|
edit: "Edit",
|
|
add: "Add",
|
|
search: "Search",
|
|
reset: "Reset",
|
|
submit: "Submit",
|
|
back: "Back",
|
|
next: "Next",
|
|
prev: "Previous",
|
|
success: "Success",
|
|
error: "Error",
|
|
warning: "Warning",
|
|
info: "Info",
|
|
yes: "Yes",
|
|
no: "No",
|
|
and: "and",
|
|
required: "Required",
|
|
optional: "Optional",
|
|
all: "All",
|
|
noData: "No Data",
|
|
viewMore: "View More",
|
|
viewAll: "View All",
|
|
contact: "Contact Us",
|
|
learnMore: "Learn More",
|
|
goNow: "Go Now",
|
|
tryNow: "Try Now",
|
|
processing: "Processing...",
|
|
devEnv: "Dev Environment",
|
|
prodEnv: "Production Environment"
|
|
},
|
|
// Home page
|
|
home: {
|
|
// Hero section
|
|
heroTag: "OpenClaw Official Partner Platform",
|
|
heroTitle: "AI-Native Application Development Platform: Next-Gen AI Agent Platform Integrated with OpenClaw Ecosystem",
|
|
heroDesc: 'For AI-era business scenarios like websites, e-commerce, and mini-programs. Deeply integrated with OpenClaw open-source AI Agent framework; built-in AI agent engine supporting knowledge base Q&A, intelligent customer service, content generation, automated workflows and multi-platform integration. Automatically create tenants, initialize modules and data after customer payment - "Pay to Activate, AI Ready to Use".',
|
|
bookDemo: "Book Demo",
|
|
viewFlow: "View Activation Flow",
|
|
deploy: "Private Deployment",
|
|
// OpenClaw ecosystem
|
|
openclawTitle: "Deep Integration with OpenClaw Open-Source Framework",
|
|
openclawSubtitle: "AI Agent Ecosystem",
|
|
openclawDesc: 'MIT open-source licensed, 315K+ GitHub stars, giving AI "hands" to execute complex tasks',
|
|
// AI capability cards
|
|
multiPlatform: "Multi-Platform Seamless Integration",
|
|
multiPlatformDesc: "Support 20+ communication platforms including WhatsApp, Telegram, Discord, Feishu, WeChat - one AI serving multiple channels simultaneously",
|
|
multiModel: "Flexible Multi-Model Switching",
|
|
multiModelDesc: "Support 25+ LLMs including Claude, GPT, DeepSeek, Ollama - local deployment for data privacy",
|
|
autoWorkflow: "Automated Workflows",
|
|
autoWorkflowDesc: 'Scheduled tasks, skill systems, MCP tool extensions - upgrade AI from "can talk" to "can do"',
|
|
experienceAI: "Experience AI Agent",
|
|
// Product matrix
|
|
productMatrix: "Product Matrix",
|
|
productMatrixDesc: "Marketable products for different business scenarios, supporting package sales, pay-to-activate, template/plugin add-ons and private deployment.",
|
|
recommend: "Recommended",
|
|
// Core capabilities
|
|
coreCapabilities: "Core Capabilities",
|
|
coreCapabilitiesDesc: "Cover product sales, delivery activation, operational upgrades and ecosystem monetization with one platform.",
|
|
// OpenClaw AI Agent
|
|
openclawAI: "OpenClaw AI Agent",
|
|
openclawAIDesc: "Deep integration with OpenClaw framework, support 20+ platform access, 25+ model switching - let AI truly execute tasks.",
|
|
// RAG Knowledge Base
|
|
ragKnowledge: "RAG Knowledge Base",
|
|
ragKnowledgeDesc: "Enterprise-grade RAG solution with document parsing, vector storage, intelligent retrieval and Q&A - greatly improve AI response quality.",
|
|
// SaaS Multi-tenant
|
|
saasMultiTenant: "SaaS Multi-Tenant Platform",
|
|
saasMultiTenantDesc: "Tenant isolation, organization and permission system, configuration center and audit capabilities - unified foundation for multiple business lines.",
|
|
// Private Deployment
|
|
privateDeploy: "Private Deployment",
|
|
privateDeployDesc: "Support local/private cloud deployment with deployment documentation, acceptance checklist and upgrade strategy - meet security compliance.",
|
|
// Template Market
|
|
templateMarket: "Template Market",
|
|
templateMarketDesc: "Industry templates one-click apply with default configs and init scripts - more standardized delivery, faster launch.",
|
|
// Auto Activation
|
|
autoActivate: "Auto Activation Chain",
|
|
autoActivateDesc: "After payment: auto-create tenant, initialize modules/menus/data, and deliver access.",
|
|
// Pay to activate
|
|
payToActivate: "Pay to Activate",
|
|
payToActivateDesc: "After customer selects and pays for a product, the platform automatically: creates tenant, initializes modules, writes default configs and data, generates admin account and delivers access.",
|
|
viewFullFlow: "View Full Flow",
|
|
// Activation flow steps
|
|
selectProduct: "Select Product/Package",
|
|
selectProductDesc: "Support product matrix, template/plugin add-ons, value-added items",
|
|
placeOrder: "Place Order & Pay",
|
|
placeOrderDesc: "Payment success triggers activation task orchestration",
|
|
createTenant: "Create Tenant",
|
|
createTenantDesc: "Tenant isolation, domain/app info binding, admin generation",
|
|
initModules: "Initialize Modules",
|
|
initModulesDesc: "Load modules and menu permissions per purchased product, write base/sample data",
|
|
deliverOnline: "Deliver & Go Live",
|
|
deliverOnlineDesc: "SaaS ready to use; private deployment delivers images/docs/acceptance checklist",
|
|
// Templates and Plugins
|
|
templatePluginEcosystem: "Template & Plugin Ecosystem",
|
|
templatePluginDesc: "Accelerate delivery with templates, extend capabilities with plugins; support purchase, authorization, updates and version management.",
|
|
template: "Template",
|
|
plugin: "Plugin",
|
|
industryTemplate: "Industry Templates",
|
|
industryTemplateDesc: "Complete pages and configs by industry/scenario, support one-click apply, secondary editing and multi-version management.",
|
|
deliveryStandard: "Delivery Standardization",
|
|
deliveryStandardDesc: 'Templates paired with init scripts make "post-activation default site" directly acceptable.',
|
|
capabilityExtend: "Capability Extension",
|
|
capabilityExtendDesc: "Payment, membership, marketing, tickets, data analytics - add capabilities on demand, use immediately.",
|
|
upgradeAuth: "Upgrade & Authorization",
|
|
upgradeAuthDesc: "Support version upgrades, authorization verification, renewal and canary release.",
|
|
exploreMarket: "Explore Template/Plugin Market",
|
|
// CTA
|
|
ctaTitle: "Want to quickly build and deliver an operational product?",
|
|
ctaDesc: "Book a demo and we'll provide a solution and quote based on your business scenario.",
|
|
viewProducts: "View Product Matrix",
|
|
contactNow: "Contact Now",
|
|
// Video
|
|
videoNotSupported: "Your browser does not support video playback"
|
|
},
|
|
// Login page
|
|
login: {
|
|
// Left brand area
|
|
aiPlatform: "AI-Native Development Platform",
|
|
buildNextGen: "Build Next-Gen\nAI Applications",
|
|
lowcodeAccess: "Low-Code Access \xB7 Multi-Model Scheduling \xB7 Agent Workflows",
|
|
fromIdeaToOnline: "From Idea to Launch, Efficiency Throughout",
|
|
developers: "Developers",
|
|
aiApps: "AI Apps",
|
|
uptime: "Uptime",
|
|
copyright: "\xA9 2025 Websopy \xB7 Secure \xB7 Stable \xB7 Efficient",
|
|
// Right form
|
|
aiAppPlatform: "AI Application Platform",
|
|
// QR scan login
|
|
scanLogin: "Scan to Login",
|
|
scanLoginDesc: "Use the App to scan QR code for quick login",
|
|
// Welcome back
|
|
welcomeBack: "Welcome Back",
|
|
loginToContinue: "Please login to continue",
|
|
// Login methods
|
|
phoneLogin: "Phone Login",
|
|
accountLogin: "Account Login",
|
|
// Input placeholders
|
|
accountPlaceholder: "Account / User ID",
|
|
passwordPlaceholder: "Password",
|
|
captchaPlaceholder: "Captcha Code",
|
|
phonePlaceholder: "Enter phone number",
|
|
smsCodePlaceholder: "Enter SMS code",
|
|
// Actions
|
|
rememberLogin: "Remember Login",
|
|
clickRefresh: "Click to refresh",
|
|
clickGet: "Click to get",
|
|
sendCode: "Send Code",
|
|
resendAfter: "s to resend",
|
|
loginNow: "Login Now",
|
|
loggingIn: "Logging in...",
|
|
// Agreement
|
|
agreeTerms: "I have read and agree to",
|
|
registerAgreement: "Terms of Service",
|
|
privacyPolicy: "Privacy Policy",
|
|
agreeRequired: "Please read and agree to the Terms of Service and Privacy Policy",
|
|
// Switch
|
|
switchToPhone: "Switch to Phone Login",
|
|
switchToScan: "Scan Login",
|
|
// Security verification modal
|
|
securityVerify: "Security Verification",
|
|
completeVerifyFirst: "Please complete the captcha verification first",
|
|
enterImgCode: "Enter captcha code",
|
|
imgCodeIncorrect: "Incorrect captcha code",
|
|
// Select account
|
|
selectAccount: "Select Account",
|
|
tenantId: "Tenant ID",
|
|
// Error messages
|
|
enterAccount: "Please enter account",
|
|
enterPassword: "Please enter password",
|
|
enterCaptcha: "Please enter captcha",
|
|
enterPhone: "Please enter phone number",
|
|
phoneFormatError: "Invalid phone number format",
|
|
enterSmsCode: "Please enter SMS code",
|
|
// Messages
|
|
smsSentSuccess: "SMS code sent successfully, please check",
|
|
sendFailed: "Send failed",
|
|
loginSuccess: "Login successful",
|
|
loginFailed: "Login failed",
|
|
scanLoginSuccess: "Scan login successful",
|
|
scanLoginFailed: "Scan login failed"
|
|
},
|
|
// Navigation
|
|
nav: {
|
|
home: "Home",
|
|
products: "Products",
|
|
pricing: "Pricing",
|
|
docs: "Docs",
|
|
blog: "Blog",
|
|
about: "About",
|
|
contact: "Contact",
|
|
login: "Login",
|
|
register: "Register",
|
|
dashboard: "Dashboard",
|
|
userCenter: "Account",
|
|
logout: "Logout",
|
|
language: "Language",
|
|
navigation: "Navigation",
|
|
orders: "My Orders",
|
|
developer: "Developer Center",
|
|
admin: "Admin"
|
|
},
|
|
// Developer Center
|
|
developer: {
|
|
title: "Developer Center",
|
|
overview: "Overview",
|
|
myApps: "My Apps",
|
|
resources: "Resources",
|
|
git: "Git Binding",
|
|
permissionRequests: "Permission Requests",
|
|
apiDocs: "API Docs",
|
|
settings: "Settings"
|
|
},
|
|
// Resource Center
|
|
resources: {
|
|
title: "Resource Center",
|
|
servers: "Servers",
|
|
databases: "Databases",
|
|
storage: "Storage",
|
|
domains: "Domains",
|
|
ssl: "SSL Certificates",
|
|
addResource: "Add Resource",
|
|
resourceType: "Resource Type",
|
|
resourceName: "Resource Name",
|
|
status: "Status",
|
|
createTime: "Create Time",
|
|
expireTime: "Expire Time",
|
|
actions: "Actions",
|
|
active: "Active",
|
|
stopped: "Stopped",
|
|
expired: "Expired"
|
|
},
|
|
// Permission
|
|
permission: {
|
|
title: "Permission Requests",
|
|
applyNew: "Apply for New Permission",
|
|
myRequests: "My Requests",
|
|
repository: "Repository",
|
|
permission: "Permission",
|
|
status: "Status",
|
|
applyTime: "Apply Time",
|
|
pending: "Pending",
|
|
approved: "Approved",
|
|
rejected: "Rejected",
|
|
applyReason: "Reason",
|
|
submit: "Submit Request"
|
|
},
|
|
// Page Titles
|
|
pageTitle: {
|
|
// Home SEO
|
|
homeTitle: "AI-Native Application Development Platform - Next-Gen AI Agent Platform Integrated with OpenClaw",
|
|
homeDescription: "Deep integration with OpenClaw open-source framework (315K+ GitHub Stars), providing SaaS multi-tenant, AI agents, RAG knowledge base and private deployment. Support 20+ platform access, 25+ model switching - let AI truly execute complex tasks.",
|
|
// Login
|
|
loginTitle: "Login",
|
|
// Developer Center
|
|
developerCenter: "Developer Center",
|
|
// Resource Center
|
|
resourceCenter: "Resource Center",
|
|
// Permission Request
|
|
permissionRequest: "Permission Request"
|
|
}
|
|
};
|
|
|
|
// @ts-nocheck
|
|
const localeCodes = [
|
|
"zh-CN",
|
|
"en"
|
|
];
|
|
const localeLoaders = {
|
|
"zh-CN": [
|
|
{
|
|
key: "locale_zh_45CN_46ts_03fdcfef",
|
|
load: () => Promise.resolve(locale_zh_45CN_46ts_03fdcfef),
|
|
cache: true
|
|
}
|
|
],
|
|
en: [
|
|
{
|
|
key: "locale_en_46ts_f974ebc9",
|
|
load: () => Promise.resolve(locale_en_46ts_f974ebc9),
|
|
cache: true
|
|
}
|
|
]
|
|
};
|
|
const vueI18nConfigs = [];
|
|
const normalizedLocales = [
|
|
{
|
|
code: "zh-CN",
|
|
name: "简体中文",
|
|
language: undefined
|
|
},
|
|
{
|
|
code: "en",
|
|
name: "English",
|
|
language: undefined
|
|
}
|
|
];
|
|
|
|
const setupVueI18nOptions = async (defaultLocale) => {
|
|
const options = await loadVueI18nOptions(vueI18nConfigs);
|
|
options.locale = defaultLocale || options.locale || "en-US";
|
|
options.defaultLocale = defaultLocale;
|
|
options.fallbackLocale ??= false;
|
|
options.messages ??= {};
|
|
for (const locale of localeCodes) {
|
|
options.messages[locale] ??= {};
|
|
}
|
|
return options;
|
|
};
|
|
|
|
function defineNitroPlugin(def) {
|
|
return def;
|
|
}
|
|
|
|
function defineRenderHandler(render) {
|
|
const runtimeConfig = useRuntimeConfig();
|
|
return eventHandler(async (event) => {
|
|
const nitroApp = useNitroApp();
|
|
const ctx = { event, render, response: void 0 };
|
|
await nitroApp.hooks.callHook("render:before", ctx);
|
|
if (!ctx.response) {
|
|
if (event.path === `${runtimeConfig.app.baseURL}favicon.ico`) {
|
|
setResponseHeader(event, "Content-Type", "image/x-icon");
|
|
return send(
|
|
event,
|
|
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
|
|
);
|
|
}
|
|
ctx.response = await ctx.render(event);
|
|
if (!ctx.response) {
|
|
const _currentStatus = getResponseStatus(event);
|
|
setResponseStatus(event, _currentStatus === 200 ? 500 : _currentStatus);
|
|
return send(
|
|
event,
|
|
"No response returned from render handler: " + event.path
|
|
);
|
|
}
|
|
}
|
|
await nitroApp.hooks.callHook("render:response", ctx.response, ctx);
|
|
if (ctx.response.headers) {
|
|
setResponseHeaders(event, ctx.response.headers);
|
|
}
|
|
if (ctx.response.statusCode || ctx.response.statusMessage) {
|
|
setResponseStatus(
|
|
event,
|
|
ctx.response.statusCode,
|
|
ctx.response.statusMessage
|
|
);
|
|
}
|
|
return ctx.response.body;
|
|
});
|
|
}
|
|
|
|
const scheduledTasks = false;
|
|
|
|
const tasks = {
|
|
|
|
};
|
|
|
|
const __runningTasks__ = {};
|
|
async function runTask(name, {
|
|
payload = {},
|
|
context = {}
|
|
} = {}) {
|
|
if (__runningTasks__[name]) {
|
|
return __runningTasks__[name];
|
|
}
|
|
if (!(name in tasks)) {
|
|
throw createError({
|
|
message: `Task \`${name}\` is not available!`,
|
|
statusCode: 404
|
|
});
|
|
}
|
|
if (!tasks[name].resolve) {
|
|
throw createError({
|
|
message: `Task \`${name}\` is not implemented!`,
|
|
statusCode: 501
|
|
});
|
|
}
|
|
const handler = await tasks[name].resolve();
|
|
const taskEvent = { name, payload, context };
|
|
__runningTasks__[name] = handler.run(taskEvent);
|
|
try {
|
|
const res = await __runningTasks__[name];
|
|
return res;
|
|
} finally {
|
|
delete __runningTasks__[name];
|
|
}
|
|
}
|
|
|
|
function buildAssetsDir() {
|
|
return useRuntimeConfig().app.buildAssetsDir;
|
|
}
|
|
function buildAssetsURL(...path) {
|
|
return joinRelativeURL(publicAssetsURL(), buildAssetsDir(), ...path);
|
|
}
|
|
function publicAssetsURL(...path) {
|
|
const app = useRuntimeConfig().app;
|
|
const publicBase = app.cdnURL || app.baseURL;
|
|
return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
|
|
}
|
|
|
|
const checksums = {
|
|
"docs": "v3.5.0--jyttfyMCdlkkD2Cy6uAigSOupLz7w9JK12BEQDx-Jb8"
|
|
};
|
|
const checksumsStructure = {
|
|
"docs": "quFkNIUZZFAwcn0ok74-KsIERem9u0p5DW-cqEgxrPA"
|
|
};
|
|
const tables = {
|
|
"docs": "_content_docs",
|
|
"info": "_content_info"
|
|
};
|
|
const contentManifest = {
|
|
"docs": {
|
|
"type": "page",
|
|
"fields": {
|
|
"id": "string",
|
|
"title": "string",
|
|
"body": "json",
|
|
"description": "string",
|
|
"extension": "string",
|
|
"meta": "json",
|
|
"navigation": "json",
|
|
"path": "string",
|
|
"seo": "json",
|
|
"stem": "string"
|
|
}
|
|
},
|
|
"info": {
|
|
"type": "data",
|
|
"fields": {}
|
|
}
|
|
};
|
|
|
|
async function fetchContent(event, collection, path, options) {
|
|
const headers = event ? getRequestHeaders(event) : {};
|
|
headers["accept-encoding"] = void 0;
|
|
const url = `/__nuxt_content/${collection}/${path}`;
|
|
const fetchOptions = {
|
|
...options,
|
|
headers: {
|
|
...headers,
|
|
...options.headers
|
|
},
|
|
query: { v: checksums[String(collection)], t: Date.now() }
|
|
};
|
|
return event ? await event.$fetch(url, fetchOptions) : await $fetch(url, fetchOptions);
|
|
}
|
|
async function fetchDatabase(event, collection) {
|
|
return fetchContent(event, collection, "sql_dump.txt", {
|
|
responseType: "text",
|
|
headers: {
|
|
"content-type": "text/plain"
|
|
}
|
|
});
|
|
}
|
|
|
|
function parseAcceptLanguage(value) {
|
|
return value.split(",").map((tag) => tag.split(";")[0]).filter(
|
|
(tag) => !(tag === "*" || tag === "")
|
|
);
|
|
}
|
|
function createPathIndexLanguageParser(index = 0) {
|
|
return (path) => {
|
|
const rawPath = typeof path === "string" ? path : path.pathname;
|
|
const normalizedPath = rawPath.split("?")[0];
|
|
const parts = normalizedPath.split("/");
|
|
if (parts[0] === "") {
|
|
parts.shift();
|
|
}
|
|
return parts.length > index ? parts[index] || "" : "";
|
|
};
|
|
}
|
|
|
|
function useRuntimeI18n(nuxtApp, event) {
|
|
{
|
|
return useRuntimeConfig(event).public.i18n;
|
|
}
|
|
}
|
|
function useI18nDetection(nuxtApp) {
|
|
const detectBrowserLanguage = useRuntimeI18n().detectBrowserLanguage;
|
|
const detect = detectBrowserLanguage || {};
|
|
return {
|
|
...detect,
|
|
enabled: !!detectBrowserLanguage,
|
|
cookieKey: detect.cookieKey || "i18n_redirected"
|
|
};
|
|
}
|
|
function resolveRootRedirect(config) {
|
|
if (!config) {
|
|
return void 0;
|
|
}
|
|
return {
|
|
path: "/" + (isString(config) ? config : config.path).replace(/^\//, ""),
|
|
code: !isString(config) && config.statusCode || 302
|
|
};
|
|
}
|
|
function toArray(value) {
|
|
return Array.isArray(value) ? value : [value];
|
|
}
|
|
|
|
function createLocaleConfigs(fallbackLocale) {
|
|
const localeConfigs = {};
|
|
for (const locale of localeCodes) {
|
|
const fallbacks = getFallbackLocaleCodes(fallbackLocale, [locale]);
|
|
const cacheable = isLocaleWithFallbacksCacheable(locale, fallbacks);
|
|
localeConfigs[locale] = { fallbacks, cacheable };
|
|
}
|
|
return localeConfigs;
|
|
}
|
|
function getFallbackLocaleCodes(fallback, locales) {
|
|
if (fallback === false) {
|
|
return [];
|
|
}
|
|
if (isArray(fallback)) {
|
|
return fallback;
|
|
}
|
|
let fallbackLocales = [];
|
|
if (isString(fallback)) {
|
|
if (locales.every((locale) => locale !== fallback)) {
|
|
fallbackLocales.push(fallback);
|
|
}
|
|
return fallbackLocales;
|
|
}
|
|
const targets = [...locales, "default"];
|
|
for (const locale of targets) {
|
|
if (locale in fallback == false) {
|
|
continue;
|
|
}
|
|
fallbackLocales = [...fallbackLocales, ...fallback[locale].filter(Boolean)];
|
|
}
|
|
return fallbackLocales;
|
|
}
|
|
function isLocaleCacheable(locale) {
|
|
return localeLoaders[locale] != null && localeLoaders[locale].every((loader) => loader.cache !== false);
|
|
}
|
|
function isLocaleWithFallbacksCacheable(locale, fallbackLocales) {
|
|
return isLocaleCacheable(locale) && fallbackLocales.every((fallbackLocale) => isLocaleCacheable(fallbackLocale));
|
|
}
|
|
function getDefaultLocaleForDomain(host) {
|
|
return normalizedLocales.find((l) => !!l.defaultForDomains?.includes(host))?.code;
|
|
}
|
|
const isSupportedLocale = (locale) => localeCodes.includes(locale || "");
|
|
|
|
function useI18nContext(event) {
|
|
if (event.context.nuxtI18n == null) {
|
|
throw new Error("Nuxt I18n server context has not been set up yet.");
|
|
}
|
|
return event.context.nuxtI18n;
|
|
}
|
|
function tryUseI18nContext(event) {
|
|
return event.context.nuxtI18n;
|
|
}
|
|
const getHost = (event) => getRequestURL(event, { xForwardedHost: true }).host;
|
|
async function initializeI18nContext(event) {
|
|
const runtimeI18n = useRuntimeI18n(void 0, event);
|
|
const defaultLocale = runtimeI18n.defaultLocale || "";
|
|
const options = await setupVueI18nOptions(getDefaultLocaleForDomain(getHost(event)) || defaultLocale);
|
|
const localeConfigs = createLocaleConfigs(options.fallbackLocale);
|
|
const ctx = createI18nContext();
|
|
ctx.vueI18nOptions = options;
|
|
ctx.localeConfigs = localeConfigs;
|
|
event.context.nuxtI18n = ctx;
|
|
return ctx;
|
|
}
|
|
function createI18nContext() {
|
|
return {
|
|
messages: {},
|
|
slp: {},
|
|
localeConfigs: {},
|
|
trackMap: {},
|
|
vueI18nOptions: void 0,
|
|
trackKey(key, locale) {
|
|
this.trackMap[locale] ??= /* @__PURE__ */ new Set();
|
|
this.trackMap[locale].add(key);
|
|
}
|
|
};
|
|
}
|
|
|
|
function matchBrowserLocale(locales, browserLocales) {
|
|
const matchedLocales = [];
|
|
for (const [index, browserCode] of browserLocales.entries()) {
|
|
const matchedLocale = locales.find((l) => l.language?.toLowerCase() === browserCode.toLowerCase());
|
|
if (matchedLocale) {
|
|
matchedLocales.push({ code: matchedLocale.code, score: 1 - index / browserLocales.length });
|
|
break;
|
|
}
|
|
}
|
|
for (const [index, browserCode] of browserLocales.entries()) {
|
|
const languageCode = browserCode.split("-")[0].toLowerCase();
|
|
const matchedLocale = locales.find((l) => l.language?.split("-")[0].toLowerCase() === languageCode);
|
|
if (matchedLocale) {
|
|
matchedLocales.push({ code: matchedLocale.code, score: 0.999 - index / browserLocales.length });
|
|
break;
|
|
}
|
|
}
|
|
return matchedLocales;
|
|
}
|
|
function compareBrowserLocale(a, b) {
|
|
if (a.score === b.score) {
|
|
return b.code.length - a.code.length;
|
|
}
|
|
return b.score - a.score;
|
|
}
|
|
function findBrowserLocale(locales, browserLocales) {
|
|
const matchedLocales = matchBrowserLocale(
|
|
locales.map((l) => ({ code: l.code, language: l.language || l.code })),
|
|
browserLocales
|
|
);
|
|
return matchedLocales.sort(compareBrowserLocale).at(0)?.code ?? "";
|
|
}
|
|
|
|
const appHead = {"meta":[{"charset":"utf-8"},{"name":"viewport","content":"width=device-width, initial-scale=1"},{"name":"robots","content":"index,follow"}],"link":[{"rel":"icon","type":"image/x-icon","href":"/favicon.ico"}],"style":[],"script":[],"noscript":[],"titleTemplate":"%s - websopy"};
|
|
|
|
const appRootTag = "div";
|
|
|
|
const appRootAttrs = {"id":"__nuxt"};
|
|
|
|
const appTeleportTag = "div";
|
|
|
|
const appTeleportAttrs = {"id":"teleports"};
|
|
|
|
const appSpaLoaderTag = "div";
|
|
|
|
const appSpaLoaderAttrs = {"id":"__nuxt-loader"};
|
|
|
|
const appId = "nuxt-app";
|
|
|
|
const separator = "___";
|
|
const pathLanguageParser = createPathIndexLanguageParser(0);
|
|
const getLocaleFromRoutePath = (path) => pathLanguageParser(path);
|
|
const getLocaleFromRouteName = (name) => name.split(separator).at(1) ?? "";
|
|
function normalizeInput(input) {
|
|
return typeof input !== "object" ? String(input) : String(input?.name || input?.path || "");
|
|
}
|
|
function getLocaleFromRoute(route) {
|
|
const input = normalizeInput(route);
|
|
return input[0] === "/" ? getLocaleFromRoutePath(input) : getLocaleFromRouteName(input);
|
|
}
|
|
|
|
function matchDomainLocale(locales, host, pathLocale) {
|
|
const normalizeDomain = (domain = "") => domain.replace(/https?:\/\//, "");
|
|
const matches = locales.filter(
|
|
(locale) => normalizeDomain(locale.domain) === host || toArray(locale.domains).includes(host)
|
|
);
|
|
if (matches.length <= 1) {
|
|
return matches[0]?.code;
|
|
}
|
|
return (
|
|
// match by current path locale
|
|
matches.find((l) => l.code === pathLocale)?.code || matches.find((l) => l.defaultForDomains?.includes(host) ?? l.domainDefault)?.code
|
|
);
|
|
}
|
|
|
|
const getCookieLocale = (event, cookieName) => (getCookie(event, cookieName)) || void 0;
|
|
const getRouteLocale = (event, route) => getLocaleFromRoute(route);
|
|
const getHeaderLocale = (event) => findBrowserLocale(normalizedLocales, parseAcceptLanguage(getRequestHeader(event, "accept-language") || ""));
|
|
const getHostLocale = (event, path, domainLocales) => {
|
|
const host = getRequestURL(event, { xForwardedHost: true }).host;
|
|
const locales = normalizedLocales.map((l) => ({
|
|
...l,
|
|
domain: domainLocales[l.code]?.domain ?? l.domain
|
|
}));
|
|
return matchDomainLocale(locales, host, getLocaleFromRoutePath(path));
|
|
};
|
|
const useDetectors = (event, config, nuxtApp) => {
|
|
if (!event) {
|
|
throw new Error("H3Event is required for server-side locale detection");
|
|
}
|
|
const runtimeI18n = useRuntimeI18n();
|
|
return {
|
|
cookie: () => getCookieLocale(event, config.cookieKey),
|
|
header: () => getHeaderLocale(event) ,
|
|
navigator: () => void 0,
|
|
host: (path) => getHostLocale(event, path, runtimeI18n.domainLocales),
|
|
route: (path) => getRouteLocale(event, path)
|
|
};
|
|
};
|
|
|
|
// Generated by @nuxtjs/i18n
|
|
const pathToI18nConfig = {};
|
|
const i18nPathToPath = {};
|
|
|
|
const formatTrailingSlash = withoutTrailingSlash;
|
|
const matcher = createRouterMatcher([], {});
|
|
for (const path of Object.keys(i18nPathToPath)) {
|
|
matcher.addRoute({ path, component: () => "", meta: {} });
|
|
}
|
|
const getI18nPathToI18nPath = (path, locale) => {
|
|
if (!path || !locale) {
|
|
return;
|
|
}
|
|
const plainPath = i18nPathToPath[path];
|
|
const i18nConfig = pathToI18nConfig[plainPath];
|
|
if (i18nConfig && i18nConfig[locale]) {
|
|
return i18nConfig[locale] === true ? plainPath : i18nConfig[locale];
|
|
}
|
|
};
|
|
function isExistingNuxtRoute(path) {
|
|
if (path === "") {
|
|
return;
|
|
}
|
|
if (path.endsWith("/__nuxt_error")) {
|
|
return;
|
|
}
|
|
const resolvedMatch = matcher.resolve({ path }, { path: "/", name: "", matched: [], params: {}, meta: {} });
|
|
return resolvedMatch.matched.length > 0 ? resolvedMatch : void 0;
|
|
}
|
|
function matchLocalized(path, locale, defaultLocale) {
|
|
if (path === "") {
|
|
return;
|
|
}
|
|
const parsed = parsePath(path);
|
|
const resolvedMatch = matcher.resolve(
|
|
{ path: parsed.pathname || "/" },
|
|
{ path: "/", name: "", matched: [], params: {}, meta: {} }
|
|
);
|
|
if (resolvedMatch.matched.length > 0) {
|
|
const alternate = getI18nPathToI18nPath(resolvedMatch.matched[0].path, locale);
|
|
const match = matcher.resolve(
|
|
{ params: resolvedMatch.params },
|
|
{ path: alternate || "/", name: "", matched: [], params: {}, meta: {} }
|
|
);
|
|
return formatTrailingSlash(withLeadingSlash(joinURL$5("", match.path)), true);
|
|
}
|
|
}
|
|
|
|
function* detect(detectors, detection, path) {
|
|
if (detection.enabled) {
|
|
yield { locale: detectors.cookie(), source: "cookie" };
|
|
yield { locale: detectors.header(), source: "header" };
|
|
}
|
|
yield { locale: detection.fallbackLocale, source: "fallback" };
|
|
}
|
|
function createRedirectResponse(event, dest, code) {
|
|
event.node.res.setHeader("location", dest);
|
|
event.node.res.statusCode = sanitizeStatusCode(code, event.node.res.statusCode);
|
|
return {
|
|
headers: event.node.res.getHeaders(),
|
|
statusCode: event.node.res.statusCode,
|
|
body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${dest.replace(/"/g, "%22")}"></head></html>`
|
|
};
|
|
}
|
|
const _xcUbjOGHb1DY_0q4vboOUFGJ6nlkQiqabJRmCaoRlCA = defineNitroPlugin(async (nitro) => {
|
|
const runtimeI18n = useRuntimeI18n();
|
|
const rootRedirect = resolveRootRedirect(runtimeI18n.rootRedirect);
|
|
runtimeI18n.defaultLocale || "";
|
|
try {
|
|
const cacheStorage = useStorage("cache");
|
|
const cachedKeys = await cacheStorage.getKeys("nitro:handlers:i18n");
|
|
await Promise.all(cachedKeys.map((key) => cacheStorage.removeItem(key)));
|
|
} catch {
|
|
}
|
|
const detection = useI18nDetection();
|
|
const cookieOptions = {
|
|
path: "/",
|
|
domain: detection.cookieDomain || void 0,
|
|
maxAge: 60 * 60 * 24 * 365,
|
|
sameSite: "lax",
|
|
secure: detection.cookieSecure
|
|
};
|
|
const createBaseUrlGetter = () => {
|
|
isFunction(runtimeI18n.baseUrl) ? "" : runtimeI18n.baseUrl || "";
|
|
if (isFunction(runtimeI18n.baseUrl)) {
|
|
console.warn("[nuxt-i18n] Configuring baseUrl as a function is deprecated and will be removed in v11.");
|
|
return () => "";
|
|
}
|
|
return (event, defaultLocale) => {
|
|
return "";
|
|
};
|
|
};
|
|
function resolveRedirectPath(event, path, pathLocale, defaultLocale, detector) {
|
|
let locale = "";
|
|
for (const detected of detect(detector, detection, event.path)) {
|
|
if (detected.locale && isSupportedLocale(detected.locale)) {
|
|
locale = detected.locale;
|
|
break;
|
|
}
|
|
}
|
|
locale ||= defaultLocale;
|
|
function getLocalizedMatch(locale2) {
|
|
const res = matchLocalized(path || "/", locale2);
|
|
if (res && res !== event.path) {
|
|
return res;
|
|
}
|
|
}
|
|
let resolvedPath = void 0;
|
|
let redirectCode = 302;
|
|
const requestURL = getRequestURL(event);
|
|
if (rootRedirect && requestURL.pathname === "/") {
|
|
locale = detection.enabled && locale || defaultLocale;
|
|
resolvedPath = isSupportedLocale(detector.route(rootRedirect.path)) && rootRedirect.path || matchLocalized(rootRedirect.path, locale);
|
|
redirectCode = rootRedirect.code;
|
|
} else if (runtimeI18n.redirectStatusCode) {
|
|
redirectCode = runtimeI18n.redirectStatusCode;
|
|
}
|
|
switch (detection.redirectOn) {
|
|
case "root":
|
|
if (requestURL.pathname !== "/") {
|
|
break;
|
|
}
|
|
// fallthrough (root has no prefix)
|
|
case "no prefix":
|
|
if (pathLocale) {
|
|
break;
|
|
}
|
|
// fallthrough to resolve
|
|
case "all":
|
|
resolvedPath ??= getLocalizedMatch(locale);
|
|
break;
|
|
}
|
|
if (requestURL.pathname === "/" && "no_prefix" === "prefix") ;
|
|
return { path: resolvedPath, code: redirectCode, locale };
|
|
}
|
|
const baseUrlGetter = createBaseUrlGetter();
|
|
nitro.hooks.hook("request", async (event) => {
|
|
await initializeI18nContext(event);
|
|
});
|
|
nitro.hooks.hook("render:before", async (context) => {
|
|
const { event } = context;
|
|
const ctx = useI18nContext(event);
|
|
const url = getRequestURL(event);
|
|
const detector = useDetectors(event, detection);
|
|
const localeSegment = detector.route(event.path);
|
|
const pathLocale = isSupportedLocale(localeSegment) && localeSegment || void 0;
|
|
const path = (pathLocale && url.pathname.slice(pathLocale.length + 1)) ?? url.pathname;
|
|
if (!url.pathname.includes("/_i18n/7dqJCt8a") && !isExistingNuxtRoute(path)) {
|
|
return;
|
|
}
|
|
const resolved = resolveRedirectPath(event, path, pathLocale, ctx.vueI18nOptions.defaultLocale, detector);
|
|
if (resolved.path && resolved.path !== url.pathname) {
|
|
ctx.detectLocale = resolved.locale;
|
|
detection.useCookie && setCookie(event, detection.cookieKey, resolved.locale, cookieOptions);
|
|
context.response = createRedirectResponse(
|
|
event,
|
|
joinURL$5(baseUrlGetter(event, ctx.vueI18nOptions.defaultLocale), resolved.path + url.search),
|
|
resolved.code
|
|
);
|
|
return;
|
|
}
|
|
});
|
|
nitro.hooks.hook("render:html", (htmlContext, { event }) => {
|
|
tryUseI18nContext(event);
|
|
});
|
|
});
|
|
|
|
const rootDir = "/Users/gxwebsoft/VUE/tiantian-system";
|
|
|
|
const devReducers = {
|
|
VNode: (data) => isVNode(data) ? { type: data.type, props: data.props } : void 0,
|
|
URL: (data) => data instanceof URL ? data.toString() : void 0
|
|
};
|
|
const asyncContext = getContext("nuxt-dev", { asyncContext: true, AsyncLocalStorage });
|
|
const _gQl57XluY2XVUox11CYu2DV1u08gyx_aML83r_h8XmU = (nitroApp) => {
|
|
const handler = nitroApp.h3App.handler;
|
|
nitroApp.h3App.handler = (event) => {
|
|
return asyncContext.callAsync({ logs: [], event }, () => handler(event));
|
|
};
|
|
onConsoleLog((_log) => {
|
|
const ctx = asyncContext.tryUse();
|
|
if (!ctx) {
|
|
return;
|
|
}
|
|
const rawStack = captureRawStackTrace();
|
|
if (!rawStack || rawStack.includes("runtime/vite-node.mjs")) {
|
|
return;
|
|
}
|
|
const trace = [];
|
|
let filename = "";
|
|
for (const entry of parseRawStackTrace(rawStack)) {
|
|
if (entry.source === globalThis._importMeta_.url) {
|
|
continue;
|
|
}
|
|
if (EXCLUDE_TRACE_RE.test(entry.source)) {
|
|
continue;
|
|
}
|
|
filename ||= entry.source.replace(withTrailingSlash(rootDir), "");
|
|
trace.push({
|
|
...entry,
|
|
source: entry.source.startsWith("file://") ? entry.source.replace("file://", "") : entry.source
|
|
});
|
|
}
|
|
const log = {
|
|
..._log,
|
|
// Pass along filename to allow the client to display more info about where log comes from
|
|
filename,
|
|
// Clean up file names in stack trace
|
|
stack: trace
|
|
};
|
|
ctx.logs.push(log);
|
|
});
|
|
nitroApp.hooks.hook("afterResponse", () => {
|
|
const ctx = asyncContext.tryUse();
|
|
if (!ctx) {
|
|
return;
|
|
}
|
|
return nitroApp.hooks.callHook("dev:ssr-logs", { logs: ctx.logs, path: ctx.event.path });
|
|
});
|
|
nitroApp.hooks.hook("render:html", (htmlContext) => {
|
|
const ctx = asyncContext.tryUse();
|
|
if (!ctx) {
|
|
return;
|
|
}
|
|
try {
|
|
const reducers = Object.assign(/* @__PURE__ */ Object.create(null), devReducers, ctx.event.context._payloadReducers);
|
|
htmlContext.bodyAppend.unshift(`<script type="application/json" data-nuxt-logs="${appId}">${stringify(ctx.logs, reducers)}<\/script>`);
|
|
} catch (e) {
|
|
const shortError = e instanceof Error && "toString" in e ? ` Received \`${e.toString()}\`.` : "";
|
|
console.warn(`[nuxt] Failed to stringify dev server logs.${shortError} You can define your own reducer/reviver for rich types following the instructions in https://nuxt.com/docs/4.x/api/composables/use-nuxt-app#payload.`);
|
|
}
|
|
});
|
|
};
|
|
const EXCLUDE_TRACE_RE = /\/node_modules\/(?:.*\/)?(?:nuxt|nuxt-nightly|nuxt-edge|nuxt3|consola|@vue)\/|core\/runtime\/nitro/;
|
|
function onConsoleLog(callback) {
|
|
consola$1.addReporter({
|
|
log(logObj) {
|
|
callback(logObj);
|
|
}
|
|
});
|
|
consola$1.wrapConsole();
|
|
}
|
|
|
|
const plugins = [
|
|
_DJKGAv2iMHVPxZkin17vYuo6inB2bhCUpVD7WRNHPvs,
|
|
_xcUbjOGHb1DY_0q4vboOUFGJ6nlkQiqabJRmCaoRlCA,
|
|
_gQl57XluY2XVUox11CYu2DV1u08gyx_aML83r_h8XmU
|
|
];
|
|
|
|
const assets = {
|
|
"/index.mjs": {
|
|
"type": "text/javascript; charset=utf-8",
|
|
"etag": "\"26fc2-ygDl+V7YYMJ0mSpU5AmaYP4FFyY\"",
|
|
"mtime": "2026-04-09T03:56:59.765Z",
|
|
"size": 159682,
|
|
"path": "index.mjs"
|
|
},
|
|
"/index.mjs.map": {
|
|
"type": "application/json",
|
|
"etag": "\"9d6e0-8lbM8D6Iv8mk+QKpLLL+TYaN4qU\"",
|
|
"mtime": "2026-04-09T03:56:59.767Z",
|
|
"size": 644832,
|
|
"path": "index.mjs.map"
|
|
}
|
|
};
|
|
|
|
function readAsset (id) {
|
|
const serverDir = dirname$1(fileURLToPath(globalThis._importMeta_.url));
|
|
return promises.readFile(resolve$1(serverDir, assets[id].path))
|
|
}
|
|
|
|
const publicAssetBases = {};
|
|
|
|
function isPublicAssetURL(id = '') {
|
|
if (assets[id]) {
|
|
return true
|
|
}
|
|
for (const base in publicAssetBases) {
|
|
if (id.startsWith(base)) { return true }
|
|
}
|
|
return false
|
|
}
|
|
|
|
function getAsset (id) {
|
|
return assets[id]
|
|
}
|
|
|
|
const METHODS = /* @__PURE__ */ new Set(["HEAD", "GET"]);
|
|
const EncodingMap = { gzip: ".gz", br: ".br" };
|
|
const _GDDPwK = eventHandler((event) => {
|
|
if (event.method && !METHODS.has(event.method)) {
|
|
return;
|
|
}
|
|
let id = decodePath(
|
|
withLeadingSlash(withoutTrailingSlash(parseURL(event.path).pathname))
|
|
);
|
|
let asset;
|
|
const encodingHeader = String(
|
|
getRequestHeader(event, "accept-encoding") || ""
|
|
);
|
|
const encodings = [
|
|
...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(),
|
|
""
|
|
];
|
|
if (encodings.length > 1) {
|
|
appendResponseHeader(event, "Vary", "Accept-Encoding");
|
|
}
|
|
for (const encoding of encodings) {
|
|
for (const _id of [id + encoding, joinURL$5(id, "index.html" + encoding)]) {
|
|
const _asset = getAsset(_id);
|
|
if (_asset) {
|
|
asset = _asset;
|
|
id = _id;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (!asset) {
|
|
if (isPublicAssetURL(id)) {
|
|
removeResponseHeader(event, "Cache-Control");
|
|
throw createError({ statusCode: 404 });
|
|
}
|
|
return;
|
|
}
|
|
const ifNotMatch = getRequestHeader(event, "if-none-match") === asset.etag;
|
|
if (ifNotMatch) {
|
|
setResponseStatus(event, 304, "Not Modified");
|
|
return "";
|
|
}
|
|
const ifModifiedSinceH = getRequestHeader(event, "if-modified-since");
|
|
const mtimeDate = new Date(asset.mtime);
|
|
if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) {
|
|
setResponseStatus(event, 304, "Not Modified");
|
|
return "";
|
|
}
|
|
if (asset.type && !getResponseHeader(event, "Content-Type")) {
|
|
setResponseHeader(event, "Content-Type", asset.type);
|
|
}
|
|
if (asset.etag && !getResponseHeader(event, "ETag")) {
|
|
setResponseHeader(event, "ETag", asset.etag);
|
|
}
|
|
if (asset.mtime && !getResponseHeader(event, "Last-Modified")) {
|
|
setResponseHeader(event, "Last-Modified", mtimeDate.toUTCString());
|
|
}
|
|
if (asset.encoding && !getResponseHeader(event, "Content-Encoding")) {
|
|
setResponseHeader(event, "Content-Encoding", asset.encoding);
|
|
}
|
|
if (asset.size > 0 && !getResponseHeader(event, "Content-Length")) {
|
|
setResponseHeader(event, "Content-Length", asset.size);
|
|
}
|
|
return readAsset(id);
|
|
});
|
|
|
|
const VueResolver = (_, value) => {
|
|
return isRef(value) ? toValue(value) : value;
|
|
};
|
|
|
|
const headSymbol = "usehead";
|
|
// @__NO_SIDE_EFFECTS__
|
|
function vueInstall(head) {
|
|
const plugin = {
|
|
install(app) {
|
|
app.config.globalProperties.$unhead = head;
|
|
app.config.globalProperties.$head = head;
|
|
app.provide(headSymbol, head);
|
|
}
|
|
};
|
|
return plugin.install;
|
|
}
|
|
|
|
// @__NO_SIDE_EFFECTS__
|
|
function resolveUnrefHeadInput(input) {
|
|
return walkResolver(input, VueResolver);
|
|
}
|
|
|
|
// @__NO_SIDE_EFFECTS__
|
|
function createHead(options = {}) {
|
|
const head = createHead$1({
|
|
...options,
|
|
propResolvers: [VueResolver]
|
|
});
|
|
head.install = vueInstall(head);
|
|
return head;
|
|
}
|
|
|
|
const unheadOptions = {
|
|
disableDefaults: true,
|
|
};
|
|
|
|
function createSSRContext(event) {
|
|
const ssrContext = {
|
|
url: event.path,
|
|
event,
|
|
runtimeConfig: useRuntimeConfig(event),
|
|
noSSR: event.context.nuxt?.noSSR || (false),
|
|
head: createHead(unheadOptions),
|
|
error: false,
|
|
nuxt: void 0,
|
|
/* NuxtApp */
|
|
payload: {},
|
|
_payloadReducers: /* @__PURE__ */ Object.create(null),
|
|
modules: /* @__PURE__ */ new Set()
|
|
};
|
|
return ssrContext;
|
|
}
|
|
function setSSRError(ssrContext, error) {
|
|
ssrContext.error = true;
|
|
ssrContext.payload = { error };
|
|
ssrContext.url = error.url;
|
|
}
|
|
|
|
const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
|
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
|
const getServerEntry = () => import('file:///Users/gxwebsoft/VUE/tiantian-system/.nuxt//dist/server/server.mjs').then((r) => r.default || r);
|
|
const getClientManifest = () => import('file:///Users/gxwebsoft/VUE/tiantian-system/.nuxt//dist/server/client.manifest.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
|
const getSSRRenderer = lazyCachedFunction(async () => {
|
|
const createSSRApp = await getServerEntry();
|
|
if (!createSSRApp) {
|
|
throw new Error("Server bundle is not available");
|
|
}
|
|
const precomputed = void 0 ;
|
|
const renderer = createRenderer(createSSRApp, {
|
|
precomputed,
|
|
manifest: await getClientManifest() ,
|
|
renderToString: renderToString$1,
|
|
buildAssetsURL
|
|
});
|
|
async function renderToString$1(input, context) {
|
|
const html = await renderToString(input, context);
|
|
if (process$1.env.NUXT_VITE_NODE_OPTIONS) {
|
|
renderer.rendererContext.updateManifest(await getClientManifest());
|
|
}
|
|
return APP_ROOT_OPEN_TAG + html + APP_ROOT_CLOSE_TAG;
|
|
}
|
|
return renderer;
|
|
});
|
|
const getSPARenderer = lazyCachedFunction(async () => {
|
|
const precomputed = void 0 ;
|
|
const spaTemplate = await Promise.resolve().then(function () { return _virtual__spaTemplate; }).then((r) => r.template).catch(() => "").then((r) => {
|
|
{
|
|
const APP_SPA_LOADER_OPEN_TAG = `<${appSpaLoaderTag}${propsToString(appSpaLoaderAttrs)}>`;
|
|
const APP_SPA_LOADER_CLOSE_TAG = `</${appSpaLoaderTag}>`;
|
|
const appTemplate = APP_ROOT_OPEN_TAG + APP_ROOT_CLOSE_TAG;
|
|
const loaderTemplate = r ? APP_SPA_LOADER_OPEN_TAG + r + APP_SPA_LOADER_CLOSE_TAG : "";
|
|
return appTemplate + loaderTemplate;
|
|
}
|
|
});
|
|
const renderer = createRenderer(() => () => {
|
|
}, {
|
|
precomputed,
|
|
manifest: await getClientManifest() ,
|
|
renderToString: () => spaTemplate,
|
|
buildAssetsURL
|
|
});
|
|
const result = await renderer.renderToString({});
|
|
const renderToString = (ssrContext) => {
|
|
const config = useRuntimeConfig(ssrContext.event);
|
|
ssrContext.modules ||= /* @__PURE__ */ new Set();
|
|
ssrContext.payload.serverRendered = false;
|
|
ssrContext.config = {
|
|
public: config.public,
|
|
app: config.app
|
|
};
|
|
return Promise.resolve(result);
|
|
};
|
|
return {
|
|
rendererContext: renderer.rendererContext,
|
|
renderToString
|
|
};
|
|
});
|
|
function lazyCachedFunction(fn) {
|
|
let res = null;
|
|
return () => {
|
|
if (res === null) {
|
|
res = fn().catch((err) => {
|
|
res = null;
|
|
throw err;
|
|
});
|
|
}
|
|
return res;
|
|
};
|
|
}
|
|
function getRenderer(ssrContext) {
|
|
return ssrContext.noSSR ? getSPARenderer() : getSSRRenderer();
|
|
}
|
|
const getSSRStyles = lazyCachedFunction(() => Promise.resolve().then(function () { return styles$1; }).then((r) => r.default || r));
|
|
|
|
async function renderInlineStyles(usedModules) {
|
|
const styleMap = await getSSRStyles();
|
|
const inlinedStyles = /* @__PURE__ */ new Set();
|
|
for (const mod of usedModules) {
|
|
if (mod in styleMap && styleMap[mod]) {
|
|
for (const style of await styleMap[mod]()) {
|
|
inlinedStyles.add(style);
|
|
}
|
|
}
|
|
}
|
|
return Array.from(inlinedStyles).map((style) => ({ innerHTML: style }));
|
|
}
|
|
|
|
const ROOT_NODE_REGEX = new RegExp(`^<${appRootTag}[^>]*>([\\s\\S]*)<\\/${appRootTag}>$`);
|
|
function getServerComponentHTML(body) {
|
|
const match = body.match(ROOT_NODE_REGEX);
|
|
return match?.[1] || body;
|
|
}
|
|
const SSR_SLOT_TELEPORT_MARKER = /^uid=([^;]*);slot=(.*)$/;
|
|
const SSR_CLIENT_TELEPORT_MARKER = /^uid=([^;]*);client=(.*)$/;
|
|
const SSR_CLIENT_SLOT_MARKER = /^island-slot=([^;]*);(.*)$/;
|
|
function getSlotIslandResponse(ssrContext) {
|
|
if (!ssrContext.islandContext || !Object.keys(ssrContext.islandContext.slots).length) {
|
|
return void 0;
|
|
}
|
|
const response = {};
|
|
for (const [name, slot] of Object.entries(ssrContext.islandContext.slots)) {
|
|
response[name] = {
|
|
...slot,
|
|
fallback: ssrContext.teleports?.[`island-fallback=${name}`]
|
|
};
|
|
}
|
|
return response;
|
|
}
|
|
function getClientIslandResponse(ssrContext) {
|
|
if (!ssrContext.islandContext || !Object.keys(ssrContext.islandContext.components).length) {
|
|
return void 0;
|
|
}
|
|
const response = {};
|
|
for (const [clientUid, component] of Object.entries(ssrContext.islandContext.components)) {
|
|
const html = ssrContext.teleports?.[clientUid]?.replaceAll("<!--teleport start anchor-->", "") || "";
|
|
response[clientUid] = {
|
|
...component,
|
|
html,
|
|
slots: getComponentSlotTeleport(clientUid, ssrContext.teleports ?? {})
|
|
};
|
|
}
|
|
return response;
|
|
}
|
|
function getComponentSlotTeleport(clientUid, teleports) {
|
|
const entries = Object.entries(teleports);
|
|
const slots = {};
|
|
for (const [key, value] of entries) {
|
|
const match = key.match(SSR_CLIENT_SLOT_MARKER);
|
|
if (match) {
|
|
const [, id, slot] = match;
|
|
if (!slot || clientUid !== id) {
|
|
continue;
|
|
}
|
|
slots[slot] = value;
|
|
}
|
|
}
|
|
return slots;
|
|
}
|
|
function replaceIslandTeleports(ssrContext, html) {
|
|
const { teleports, islandContext } = ssrContext;
|
|
if (islandContext || !teleports) {
|
|
return html;
|
|
}
|
|
for (const key in teleports) {
|
|
const matchClientComp = key.match(SSR_CLIENT_TELEPORT_MARKER);
|
|
if (matchClientComp) {
|
|
const [, uid, clientId] = matchClientComp;
|
|
if (!uid || !clientId) {
|
|
continue;
|
|
}
|
|
html = html.replace(new RegExp(` data-island-uid="${uid}" data-island-component="${clientId}"[^>]*>`), (full) => {
|
|
return full + teleports[key];
|
|
});
|
|
continue;
|
|
}
|
|
const matchSlot = key.match(SSR_SLOT_TELEPORT_MARKER);
|
|
if (matchSlot) {
|
|
const [, uid, slot] = matchSlot;
|
|
if (!uid || !slot) {
|
|
continue;
|
|
}
|
|
html = html.replace(new RegExp(` data-island-uid="${uid}" data-island-slot="${slot}"[^>]*>`), (full) => {
|
|
return full + teleports[key];
|
|
});
|
|
}
|
|
}
|
|
return html;
|
|
}
|
|
|
|
const ISLAND_SUFFIX_RE = /\.json(?:\?.*)?$/;
|
|
const _SxA8c9 = defineEventHandler(async (event) => {
|
|
const nitroApp = useNitroApp();
|
|
setResponseHeaders(event, {
|
|
"content-type": "application/json;charset=utf-8",
|
|
"x-powered-by": "Nuxt"
|
|
});
|
|
const islandContext = await getIslandContext(event);
|
|
const ssrContext = {
|
|
...createSSRContext(event),
|
|
islandContext,
|
|
noSSR: false,
|
|
url: islandContext.url
|
|
};
|
|
const renderer = await getSSRRenderer();
|
|
const renderResult = await renderer.renderToString(ssrContext).catch(async (err) => {
|
|
await ssrContext.nuxt?.hooks.callHook("app:error", err);
|
|
throw err;
|
|
});
|
|
if (ssrContext.payload?.error) {
|
|
throw ssrContext.payload.error;
|
|
}
|
|
const inlinedStyles = await renderInlineStyles(ssrContext.modules ?? []);
|
|
await ssrContext.nuxt?.hooks.callHook("app:rendered", { ssrContext, renderResult });
|
|
if (inlinedStyles.length) {
|
|
ssrContext.head.push({ style: inlinedStyles });
|
|
}
|
|
{
|
|
const { styles } = getRequestDependencies(ssrContext, renderer.rendererContext);
|
|
const link = [];
|
|
for (const resource of Object.values(styles)) {
|
|
if ("inline" in getQuery(resource.file)) {
|
|
continue;
|
|
}
|
|
if (resource.file.includes("scoped") && !resource.file.includes("pages/")) {
|
|
link.push({ rel: "stylesheet", href: renderer.rendererContext.buildAssetsURL(resource.file), crossorigin: "" });
|
|
}
|
|
}
|
|
if (link.length) {
|
|
ssrContext.head.push({ link }, { mode: "server" });
|
|
}
|
|
}
|
|
const islandHead = {};
|
|
for (const entry of ssrContext.head.entries.values()) {
|
|
for (const [key, value] of Object.entries(resolveUnrefHeadInput(entry.input))) {
|
|
const currentValue = islandHead[key];
|
|
if (Array.isArray(currentValue)) {
|
|
currentValue.push(...value);
|
|
}
|
|
islandHead[key] = value;
|
|
}
|
|
}
|
|
const islandResponse = {
|
|
id: islandContext.id,
|
|
head: islandHead,
|
|
html: getServerComponentHTML(renderResult.html),
|
|
components: getClientIslandResponse(ssrContext),
|
|
slots: getSlotIslandResponse(ssrContext)
|
|
};
|
|
await nitroApp.hooks.callHook("render:island", islandResponse, { event, islandContext });
|
|
return islandResponse;
|
|
});
|
|
async function getIslandContext(event) {
|
|
let url = event.path || "";
|
|
const componentParts = url.substring("/__nuxt_island".length + 1).replace(ISLAND_SUFFIX_RE, "").split("_");
|
|
const hashId = componentParts.length > 1 ? componentParts.pop() : void 0;
|
|
const componentName = componentParts.join("_");
|
|
const context = event.method === "GET" ? getQuery$1(event) : await readBody(event);
|
|
const ctx = {
|
|
url: "/",
|
|
...context,
|
|
id: hashId,
|
|
name: componentName,
|
|
props: destr$1(context.props) || {},
|
|
slots: {},
|
|
components: {}
|
|
};
|
|
return ctx;
|
|
}
|
|
|
|
const _9gb4LH = eventHandler(async (event) => {
|
|
const collection = getRouterParam(event, "collection") || event.path?.split("/")?.[2] || "";
|
|
setHeader(event, "Content-Type", "text/plain");
|
|
const data = await useStorage().getItem(`build:content:database.compressed.mjs`) || "";
|
|
if (data) {
|
|
const lineStart = `export const ${collection} = "`;
|
|
const content = String(data).split("\n").find((line) => line.startsWith(lineStart));
|
|
if (content) {
|
|
return content.substring(lineStart.length, content.length - 1);
|
|
}
|
|
}
|
|
return await import('file:///Users/gxwebsoft/VUE/tiantian-system/.nuxt/content/database.compressed.mjs').then((m) => m[collection]);
|
|
});
|
|
|
|
const storage = prefixStorage(useStorage(), "i18n");
|
|
function cachedFunctionI18n(fn, opts) {
|
|
opts = { maxAge: 1, ...opts };
|
|
const pending = {};
|
|
async function get(key, resolver) {
|
|
const isPending = pending[key];
|
|
if (!isPending) {
|
|
pending[key] = Promise.resolve(resolver());
|
|
}
|
|
try {
|
|
return await pending[key];
|
|
} finally {
|
|
delete pending[key];
|
|
}
|
|
}
|
|
return async (...args) => {
|
|
const key = [opts.name, opts.getKey(...args)].join(":").replace(/:\/$/, ":index");
|
|
const maxAge = opts.maxAge ?? 1;
|
|
const isCacheable = !opts.shouldBypassCache(...args) && maxAge >= 0;
|
|
const cache = isCacheable && await storage.getItemRaw(key);
|
|
if (!cache || cache.ttl < Date.now()) {
|
|
pending[key] = Promise.resolve(fn(...args));
|
|
const value = await get(key, () => fn(...args));
|
|
if (isCacheable) {
|
|
await storage.setItemRaw(key, { ttl: Date.now() + maxAge * 1e3, value, mtime: Date.now() });
|
|
}
|
|
return value;
|
|
}
|
|
return cache.value;
|
|
};
|
|
}
|
|
|
|
const _getMessages = async (locale) => {
|
|
return { [locale]: await getLocaleMessagesMerged(locale, localeLoaders[locale]) };
|
|
};
|
|
cachedFunctionI18n(_getMessages, {
|
|
name: "messages",
|
|
maxAge: -1 ,
|
|
getKey: (locale) => locale,
|
|
shouldBypassCache: (locale) => !isLocaleCacheable(locale)
|
|
});
|
|
const getMessages = _getMessages ;
|
|
const _getMergedMessages = async (locale, fallbackLocales) => {
|
|
const merged = {};
|
|
try {
|
|
if (fallbackLocales.length > 0) {
|
|
const messages = await Promise.all(fallbackLocales.map(getMessages));
|
|
for (const message2 of messages) {
|
|
deepCopy(message2, merged);
|
|
}
|
|
}
|
|
const message = await getMessages(locale);
|
|
deepCopy(message, merged);
|
|
return merged;
|
|
} catch (e) {
|
|
throw new Error("Failed to merge messages: " + e.message);
|
|
}
|
|
};
|
|
const getMergedMessages = cachedFunctionI18n(_getMergedMessages, {
|
|
name: "merged-single",
|
|
maxAge: -1 ,
|
|
getKey: (locale, fallbackLocales) => `${locale}-[${[...new Set(fallbackLocales)].sort().join("-")}]`,
|
|
shouldBypassCache: (locale, fallbackLocales) => !isLocaleWithFallbacksCacheable(locale, fallbackLocales)
|
|
});
|
|
const _getAllMergedMessages = async (locales) => {
|
|
const merged = {};
|
|
try {
|
|
const messages = await Promise.all(locales.map(getMessages));
|
|
for (const message of messages) {
|
|
deepCopy(message, merged);
|
|
}
|
|
return merged;
|
|
} catch (e) {
|
|
throw new Error("Failed to merge messages: " + e.message);
|
|
}
|
|
};
|
|
cachedFunctionI18n(_getAllMergedMessages, {
|
|
name: "merged-all",
|
|
maxAge: -1 ,
|
|
getKey: (locales) => locales.join("-"),
|
|
shouldBypassCache: (locales) => !locales.every((locale) => isLocaleCacheable(locale))
|
|
});
|
|
|
|
const _messagesHandler = defineEventHandler(async (event) => {
|
|
const locale = getRouterParam(event, "locale");
|
|
if (!locale) {
|
|
throw createError({ status: 400, message: "Locale not specified." });
|
|
}
|
|
const ctx = useI18nContext(event);
|
|
if (ctx.localeConfigs && locale in ctx.localeConfigs === false) {
|
|
throw createError({ status: 404, message: `Locale '${locale}' not found.` });
|
|
}
|
|
const messages = await getMergedMessages(locale, ctx.localeConfigs?.[locale]?.fallbacks ?? []);
|
|
deepCopy(messages, ctx.messages);
|
|
return ctx.messages;
|
|
});
|
|
const _cachedMessageLoader = defineCachedFunction(_messagesHandler, {
|
|
name: "i18n:messages-internal",
|
|
maxAge: -1 ,
|
|
getKey: (event) => [getRouterParam(event, "locale") ?? "null", getRouterParam(event, "hash") ?? "null"].join("-"),
|
|
async shouldBypassCache(event) {
|
|
const locale = getRouterParam(event, "locale");
|
|
if (locale == null) {
|
|
return false;
|
|
}
|
|
const ctx = tryUseI18nContext(event) || await initializeI18nContext(event);
|
|
return !ctx.localeConfigs?.[locale]?.cacheable;
|
|
}
|
|
});
|
|
defineCachedEventHandler(_cachedMessageLoader, {
|
|
name: "i18n:messages",
|
|
maxAge: -1 ,
|
|
swr: false,
|
|
getKey: (event) => [getRouterParam(event, "locale") ?? "null", getRouterParam(event, "hash") ?? "null"].join("-")
|
|
});
|
|
const _PUTeKr = _messagesHandler ;
|
|
|
|
async function decompressSQLDump(base64Str, compressionType = "gzip") {
|
|
let binaryData;
|
|
if (typeof Buffer !== "undefined") {
|
|
const buffer = Buffer.from(base64Str, "base64");
|
|
binaryData = Uint8Array.from(buffer);
|
|
} else if (typeof atob !== "undefined") {
|
|
binaryData = Uint8Array.from(atob(base64Str), (c) => c.charCodeAt(0));
|
|
} else {
|
|
throw new TypeError("No base64 decoding method available");
|
|
}
|
|
const response = new Response(new Blob([binaryData]));
|
|
const decompressedStream = response.body?.pipeThrough(new DecompressionStream(compressionType));
|
|
const text = await new Response(decompressedStream).text();
|
|
return JSON.parse(text);
|
|
}
|
|
|
|
function refineContentFields(sql, doc) {
|
|
const fields = findCollectionFields(sql);
|
|
const item = { ...doc };
|
|
for (const key in item) {
|
|
if (fields[key] === "json" && item[key] && item[key] !== "undefined") {
|
|
item[key] = JSON.parse(item[key]);
|
|
}
|
|
if (fields[key] === "boolean" && item[key] !== "undefined") {
|
|
item[key] = Boolean(item[key]);
|
|
}
|
|
}
|
|
for (const key in item) {
|
|
if (item[key] === "NULL") {
|
|
item[key] = void 0;
|
|
}
|
|
}
|
|
return item;
|
|
}
|
|
function findCollectionFields(sql) {
|
|
const table = sql.match(/FROM\s+(\w+)/);
|
|
if (!table) {
|
|
return {};
|
|
}
|
|
const info = contentManifest[getCollectionName(table[1])];
|
|
return info?.fields || {};
|
|
}
|
|
function getCollectionName(table) {
|
|
return table.replace(/^_content_/, "");
|
|
}
|
|
|
|
let db;
|
|
function loadDatabaseAdapter(config) {
|
|
const { database, localDatabase } = config;
|
|
if (!db) {
|
|
{
|
|
db = localAdapter(refineDatabaseConfig(localDatabase));
|
|
}
|
|
}
|
|
return {
|
|
all: async (sql, params = []) => {
|
|
return db.prepare(sql).all(...params).then((result) => (result || []).map((item) => refineContentFields(sql, item)));
|
|
},
|
|
first: async (sql, params = []) => {
|
|
return db.prepare(sql).get(...params).then((item) => item ? refineContentFields(sql, item) : item);
|
|
},
|
|
exec: async (sql, params = []) => {
|
|
return db.prepare(sql).run(...params);
|
|
}
|
|
};
|
|
}
|
|
const checkDatabaseIntegrity = /* @__PURE__ */ new Map();
|
|
const integrityCheckPromise = /* @__PURE__ */ new Map();
|
|
async function checkAndImportDatabaseIntegrity(event, collection, config) {
|
|
if (checkDatabaseIntegrity.get(collection) !== false) {
|
|
checkDatabaseIntegrity.set(collection, false);
|
|
if (!integrityCheckPromise.has(collection)) {
|
|
const _integrityCheck = _checkAndImportDatabaseIntegrity(event, collection, checksums[collection], checksumsStructure[collection], config).then((isValid) => {
|
|
checkDatabaseIntegrity.set(collection, !isValid);
|
|
}).catch((error) => {
|
|
console.error("Database integrity check failed", error);
|
|
checkDatabaseIntegrity.set(collection, true);
|
|
integrityCheckPromise.delete(collection);
|
|
});
|
|
integrityCheckPromise.set(collection, _integrityCheck);
|
|
}
|
|
}
|
|
if (integrityCheckPromise.has(collection)) {
|
|
await integrityCheckPromise.get(collection);
|
|
}
|
|
}
|
|
async function _checkAndImportDatabaseIntegrity(event, collection, integrityVersion, structureIntegrityVersion, config) {
|
|
const db2 = loadDatabaseAdapter(config);
|
|
const before = await db2.first(`SELECT * FROM ${tables.info} WHERE id = ?`, [`checksum_${collection}`]).catch(() => null);
|
|
if (before?.version && !String(before.version)?.startsWith(`${config.databaseVersion}--`)) {
|
|
await db2.exec(`DROP TABLE IF EXISTS ${tables.info}`);
|
|
before.version = "";
|
|
}
|
|
const unchangedStructure = before?.structureVersion === structureIntegrityVersion;
|
|
if (before?.version) {
|
|
if (before.version === integrityVersion) {
|
|
if (before.ready) {
|
|
return true;
|
|
}
|
|
await waitUntilDatabaseIsReady(db2, collection);
|
|
return true;
|
|
}
|
|
await db2.exec(`DELETE FROM ${tables.info} WHERE id = ?`, [`checksum_${collection}`]);
|
|
if (!unchangedStructure) {
|
|
await db2.exec(`DROP TABLE IF EXISTS ${tables[collection]}`);
|
|
}
|
|
}
|
|
const dump = await loadDatabaseDump(event, collection).then(decompressSQLDump);
|
|
const dumpLinesHash = dump.map((row) => row.split(" -- ").pop());
|
|
let hashesInDb = /* @__PURE__ */ new Set();
|
|
if (unchangedStructure) {
|
|
const hashListFromTheDump = new Set(dumpLinesHash);
|
|
const hashesInDbRecords = await db2.all(`SELECT __hash__ FROM ${tables[collection]}`).catch(() => []);
|
|
hashesInDb = new Set(hashesInDbRecords.map((r) => r.__hash__));
|
|
const hashesToDelete = hashesInDb.difference(hashListFromTheDump);
|
|
if (hashesToDelete.size) {
|
|
await db2.exec(`DELETE FROM ${tables[collection]} WHERE __hash__ IN (${Array(hashesToDelete.size).fill("?").join(",")})`, Array.from(hashesToDelete));
|
|
}
|
|
}
|
|
await dump.reduce(async (prev, sql, index) => {
|
|
await prev;
|
|
const hash = dumpLinesHash[index];
|
|
const statement = sql.substring(0, sql.length - hash.length - 4);
|
|
if (unchangedStructure) {
|
|
if (hash === "structure") {
|
|
return Promise.resolve();
|
|
}
|
|
if (hashesInDb.has(hash)) {
|
|
return Promise.resolve();
|
|
}
|
|
}
|
|
await db2.exec(statement).catch((err) => {
|
|
const message = err.message || "Unknown error";
|
|
console.error(`Failed to execute SQL ${sql}: ${message}`);
|
|
});
|
|
}, Promise.resolve());
|
|
const after = await db2.first(`SELECT version FROM ${tables.info} WHERE id = ?`, [`checksum_${collection}`]).catch(() => ({ version: "" }));
|
|
return after?.version === integrityVersion;
|
|
}
|
|
const REQUEST_TIMEOUT = 90;
|
|
async function waitUntilDatabaseIsReady(db2, collection) {
|
|
let iterationCount = 0;
|
|
let interval;
|
|
await new Promise((resolve, reject) => {
|
|
interval = setInterval(async () => {
|
|
const row = await db2.first(`SELECT ready FROM ${tables.info} WHERE id = ?`, [`checksum_${collection}`]).catch(() => ({ ready: true }));
|
|
if (row?.ready) {
|
|
clearInterval(interval);
|
|
resolve(0);
|
|
}
|
|
if (iterationCount++ > REQUEST_TIMEOUT) {
|
|
clearInterval(interval);
|
|
reject(new Error("Waiting for another database initialization timed out"));
|
|
}
|
|
}, 1e3);
|
|
}).catch((e) => {
|
|
throw e;
|
|
}).finally(() => {
|
|
if (interval) {
|
|
clearInterval(interval);
|
|
}
|
|
});
|
|
}
|
|
async function loadDatabaseDump(event, collection) {
|
|
return await fetchDatabase(event, collection).catch((e) => {
|
|
console.error("Failed to fetch compressed dump", e);
|
|
return "";
|
|
});
|
|
}
|
|
function refineDatabaseConfig(config) {
|
|
if (config.type === "d1") {
|
|
return { ...config, bindingName: config.bindingName || config.binding };
|
|
}
|
|
if (config.type === "sqlite") {
|
|
const _config = { ...config };
|
|
if (config.filename === ":memory:") {
|
|
return { name: ":memory:" };
|
|
}
|
|
if ("filename" in config) {
|
|
const filename = isAbsolute(config?.filename || "") || config?.filename === ":memory:" ? config?.filename : new URL(config.filename, globalThis._importMeta_.url).pathname;
|
|
_config.path = process.platform === "win32" && filename.startsWith("/") ? filename.slice(1) : filename;
|
|
}
|
|
return _config;
|
|
}
|
|
if (config.type === "pglite") {
|
|
return {
|
|
dataDir: config.dataDir,
|
|
// Pass through any other PGlite-specific options
|
|
...config
|
|
};
|
|
}
|
|
return config;
|
|
}
|
|
|
|
const SQL_COMMANDS = /SELECT|INSERT|UPDATE|DELETE|DROP|ALTER|\$/i;
|
|
const SQL_COUNT_REGEX = /COUNT\((DISTINCT )?([a-z_]\w+|\*)\)/i;
|
|
const SQL_SELECT_REGEX = /^SELECT (.*) FROM (\w+)( WHERE .*)? ORDER BY (["\w,\s]+) (ASC|DESC)( LIMIT \d+)?( OFFSET \d+)?$/;
|
|
function assertSafeQuery(sql, collection) {
|
|
if (!sql) {
|
|
throw new Error("Invalid query: Query cannot be empty");
|
|
}
|
|
const cleanedupQuery = cleanupQuery(sql);
|
|
if (cleanedupQuery !== sql) {
|
|
throw new Error("Invalid query: SQL comments are not allowed");
|
|
}
|
|
const match = sql.match(SQL_SELECT_REGEX);
|
|
if (!match) {
|
|
throw new Error("Invalid query: Query must be a valid SELECT statement with proper syntax");
|
|
}
|
|
const [_, select, from, where, orderBy, order, limit, offset] = match;
|
|
const columns = select?.trim().split(", ") || [];
|
|
if (columns.length === 1) {
|
|
if (columns[0] !== "*" && !columns[0]?.match(SQL_COUNT_REGEX) && !columns[0]?.match(/^"[a-z_]\w+"$/i)) {
|
|
throw new Error(`Invalid query: Column '${columns[0]}' has invalid format. Expected *, COUNT(), or a quoted column name`);
|
|
}
|
|
} else if (!columns.every((column) => column.match(/^"[a-z_]\w+"$/i))) {
|
|
throw new Error("Invalid query: Multiple columns must be properly quoted and alphanumeric");
|
|
}
|
|
if (from !== `_content_${collection}`) {
|
|
const collection2 = String(from || "").replace(/^_content_/, "");
|
|
throw new Error(`Invalid query: Collection '${collection2}' does not exist`);
|
|
}
|
|
if (where) {
|
|
if (!where.startsWith(" WHERE (") || !where.endsWith(")")) {
|
|
throw new Error("Invalid query: WHERE clause must be properly enclosed in parentheses");
|
|
}
|
|
const noString = cleanupQuery(where, { removeString: true });
|
|
if (noString.match(SQL_COMMANDS)) {
|
|
throw new Error("Invalid query: WHERE clause contains unsafe SQL commands");
|
|
}
|
|
}
|
|
const _order = (orderBy + " " + order).split(", ");
|
|
if (!_order.every((column) => column.match(/^("[a-zA-Z_]+"|[a-zA-Z_]+) (ASC|DESC)$/))) {
|
|
throw new Error("Invalid query: ORDER BY clause must contain valid column names followed by ASC or DESC");
|
|
}
|
|
if (limit !== void 0 && !limit.match(/^ LIMIT \d+$/)) {
|
|
throw new Error("Invalid query: LIMIT clause must be a positive number");
|
|
}
|
|
if (offset !== void 0 && !offset.match(/^ OFFSET \d+$/)) {
|
|
throw new Error("Invalid query: OFFSET clause must be a positive number");
|
|
}
|
|
return true;
|
|
}
|
|
function cleanupQuery(query, options = { removeString: false }) {
|
|
let inString = false;
|
|
let stringFence = "";
|
|
let result = "";
|
|
for (let i = 0; i < query.length; i++) {
|
|
const char = query[i];
|
|
const prevChar = query[i - 1];
|
|
const nextChar = query[i + 1];
|
|
if (char === "'" || char === '"') {
|
|
if (!options?.removeString) {
|
|
result += char;
|
|
continue;
|
|
}
|
|
if (inString) {
|
|
if (char !== stringFence || nextChar === stringFence || prevChar === stringFence) {
|
|
continue;
|
|
}
|
|
inString = false;
|
|
stringFence = "";
|
|
continue;
|
|
} else {
|
|
inString = true;
|
|
stringFence = char;
|
|
continue;
|
|
}
|
|
}
|
|
if (!inString) {
|
|
if (char === "-" && nextChar === "-") {
|
|
return result;
|
|
}
|
|
if (char === "/" && nextChar === "*") {
|
|
i += 2;
|
|
while (i < query.length && !(query[i] === "*" && query[i + 1] === "/")) {
|
|
i += 1;
|
|
}
|
|
i += 2;
|
|
continue;
|
|
}
|
|
result += char;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
const _Qy8ZLN = eventHandler(async (event) => {
|
|
const { sql } = await readBody(event);
|
|
const collection = getRouterParam(event, "collection") || event.path?.split("/")?.[2] || "";
|
|
assertSafeQuery(sql, collection);
|
|
const conf = useRuntimeConfig().content;
|
|
if (conf.integrityCheck) {
|
|
await checkAndImportDatabaseIntegrity(event, collection, conf);
|
|
}
|
|
return loadDatabaseAdapter(conf).all(sql);
|
|
});
|
|
|
|
const _lazy_y0vWoN = () => Promise.resolve().then(function () { return ____path_$9; });
|
|
const _lazy_Chje6d = () => Promise.resolve().then(function () { return ____path_$7; });
|
|
const _lazy_yGTVmh = () => Promise.resolve().then(function () { return ____path_$5; });
|
|
const _lazy_2rJ_ps = () => Promise.resolve().then(function () { return ____path_$3; });
|
|
const _lazy_n8jn2M = () => Promise.resolve().then(function () { return ____path_$1; });
|
|
const _lazy_rLSC6c = () => Promise.resolve().then(function () { return getSiteInfo_get$1; });
|
|
const _lazy_yQ45rS = () => Promise.resolve().then(function () { return pageAll_get$1; });
|
|
const _lazy_e8gxXR = () => Promise.resolve().then(function () { return renderer$1; });
|
|
|
|
const handlers = [
|
|
{ route: '', handler: _GDDPwK, lazy: false, middleware: true, method: undefined },
|
|
{ route: '/api/_app/**:path', handler: _lazy_y0vWoN, lazy: true, middleware: false, method: undefined },
|
|
{ route: '/api/_file/**:path', handler: _lazy_Chje6d, lazy: true, middleware: false, method: undefined },
|
|
{ route: '/api/_modules/**:path', handler: _lazy_yGTVmh, lazy: true, middleware: false, method: undefined },
|
|
{ route: '/api/_server/**:path', handler: _lazy_2rJ_ps, lazy: true, middleware: false, method: undefined },
|
|
{ route: '/api/cms/**:path', handler: _lazy_n8jn2M, lazy: true, middleware: false, method: undefined },
|
|
{ route: '/api/cms/cms-website/getSiteInfo', handler: _lazy_rLSC6c, lazy: true, middleware: false, method: "get" },
|
|
{ route: '/api/cms/cms-website/pageAll', handler: _lazy_yQ45rS, lazy: true, middleware: false, method: "get" },
|
|
{ route: '/__nuxt_error', handler: _lazy_e8gxXR, lazy: true, middleware: false, method: undefined },
|
|
{ route: '/__nuxt_island/**', handler: _SxA8c9, lazy: false, middleware: false, method: undefined },
|
|
{ route: '/__nuxt_content/docs/sql_dump.txt', handler: _9gb4LH, lazy: false, middleware: false, method: undefined },
|
|
{ route: '/__nuxt_content/info/sql_dump.txt', handler: _9gb4LH, lazy: false, middleware: false, method: undefined },
|
|
{ route: '/_i18n/:hash/:locale/messages.json', handler: _PUTeKr, lazy: false, middleware: false, method: undefined },
|
|
{ route: '/__nuxt_content/docs/query', handler: _Qy8ZLN, lazy: false, middleware: false, method: undefined },
|
|
{ route: '/__nuxt_content/info/query', handler: _Qy8ZLN, lazy: false, middleware: false, method: undefined },
|
|
{ route: '/**', handler: _lazy_e8gxXR, lazy: true, middleware: false, method: undefined }
|
|
];
|
|
|
|
function createNitroApp() {
|
|
const config = useRuntimeConfig();
|
|
const hooks = createHooks();
|
|
const captureError = (error, context = {}) => {
|
|
const promise = hooks.callHookParallel("error", error, context).catch((error_) => {
|
|
console.error("Error while capturing another error", error_);
|
|
});
|
|
if (context.event && isEvent(context.event)) {
|
|
const errors = context.event.context.nitro?.errors;
|
|
if (errors) {
|
|
errors.push({ error, context });
|
|
}
|
|
if (context.event.waitUntil) {
|
|
context.event.waitUntil(promise);
|
|
}
|
|
}
|
|
};
|
|
const h3App = createApp({
|
|
debug: destr(true),
|
|
onError: (error, event) => {
|
|
captureError(error, { event, tags: ["request"] });
|
|
return errorHandler(error, event);
|
|
},
|
|
onRequest: async (event) => {
|
|
event.context.nitro = event.context.nitro || { errors: [] };
|
|
const fetchContext = event.node.req?.__unenv__;
|
|
if (fetchContext?._platform) {
|
|
event.context = {
|
|
_platform: fetchContext?._platform,
|
|
// #3335
|
|
...fetchContext._platform,
|
|
...event.context
|
|
};
|
|
}
|
|
if (!event.context.waitUntil && fetchContext?.waitUntil) {
|
|
event.context.waitUntil = fetchContext.waitUntil;
|
|
}
|
|
event.fetch = (req, init) => fetchWithEvent(event, req, init, { fetch: localFetch });
|
|
event.$fetch = (req, init) => fetchWithEvent(event, req, init, {
|
|
fetch: $fetch
|
|
});
|
|
event.waitUntil = (promise) => {
|
|
if (!event.context.nitro._waitUntilPromises) {
|
|
event.context.nitro._waitUntilPromises = [];
|
|
}
|
|
event.context.nitro._waitUntilPromises.push(promise);
|
|
if (event.context.waitUntil) {
|
|
event.context.waitUntil(promise);
|
|
}
|
|
};
|
|
event.captureError = (error, context) => {
|
|
captureError(error, { event, ...context });
|
|
};
|
|
await nitroApp$1.hooks.callHook("request", event).catch((error) => {
|
|
captureError(error, { event, tags: ["request"] });
|
|
});
|
|
},
|
|
onBeforeResponse: async (event, response) => {
|
|
await nitroApp$1.hooks.callHook("beforeResponse", event, response).catch((error) => {
|
|
captureError(error, { event, tags: ["request", "response"] });
|
|
});
|
|
},
|
|
onAfterResponse: async (event, response) => {
|
|
await nitroApp$1.hooks.callHook("afterResponse", event, response).catch((error) => {
|
|
captureError(error, { event, tags: ["request", "response"] });
|
|
});
|
|
}
|
|
});
|
|
const router = createRouter$1({
|
|
preemptive: true
|
|
});
|
|
const nodeHandler = toNodeListener(h3App);
|
|
const localCall = (aRequest) => callNodeRequestHandler(
|
|
nodeHandler,
|
|
aRequest
|
|
);
|
|
const localFetch = (input, init) => {
|
|
if (!input.toString().startsWith("/")) {
|
|
return globalThis.fetch(input, init);
|
|
}
|
|
return fetchNodeRequestHandler(
|
|
nodeHandler,
|
|
input,
|
|
init
|
|
).then((response) => normalizeFetchResponse(response));
|
|
};
|
|
const $fetch = createFetch({
|
|
fetch: localFetch,
|
|
Headers: Headers$1,
|
|
defaults: { baseURL: config.app.baseURL }
|
|
});
|
|
globalThis.$fetch = $fetch;
|
|
h3App.use(createRouteRulesHandler({ localFetch }));
|
|
for (const h of handlers) {
|
|
let handler = h.lazy ? lazyEventHandler(h.handler) : h.handler;
|
|
if (h.middleware || !h.route) {
|
|
const middlewareBase = (config.app.baseURL + (h.route || "/")).replace(
|
|
/\/+/g,
|
|
"/"
|
|
);
|
|
h3App.use(middlewareBase, handler);
|
|
} else {
|
|
const routeRules = getRouteRulesForPath(
|
|
h.route.replace(/:\w+|\*\*/g, "_")
|
|
);
|
|
if (routeRules.cache) {
|
|
handler = cachedEventHandler(handler, {
|
|
group: "nitro/routes",
|
|
...routeRules.cache
|
|
});
|
|
}
|
|
router.use(h.route, handler, h.method);
|
|
}
|
|
}
|
|
h3App.use(config.app.baseURL, router.handler);
|
|
const app = {
|
|
hooks,
|
|
h3App,
|
|
router,
|
|
localCall,
|
|
localFetch,
|
|
captureError
|
|
};
|
|
return app;
|
|
}
|
|
function runNitroPlugins(nitroApp2) {
|
|
for (const plugin of plugins) {
|
|
try {
|
|
plugin(nitroApp2);
|
|
} catch (error) {
|
|
nitroApp2.captureError(error, { tags: ["plugin"] });
|
|
throw error;
|
|
}
|
|
}
|
|
}
|
|
const nitroApp$1 = createNitroApp();
|
|
function useNitroApp() {
|
|
return nitroApp$1;
|
|
}
|
|
runNitroPlugins(nitroApp$1);
|
|
|
|
if (!globalThis.crypto) {
|
|
globalThis.crypto = nodeCrypto;
|
|
}
|
|
const { NITRO_NO_UNIX_SOCKET, NITRO_DEV_WORKER_ID } = process.env;
|
|
trapUnhandledNodeErrors();
|
|
parentPort?.on("message", (msg) => {
|
|
if (msg && msg.event === "shutdown") {
|
|
shutdown();
|
|
}
|
|
});
|
|
const nitroApp = useNitroApp();
|
|
const server = new Server(toNodeListener(nitroApp.h3App));
|
|
let listener;
|
|
listen().catch(() => listen(
|
|
true
|
|
/* use random port */
|
|
)).catch((error) => {
|
|
console.error("Dev worker failed to listen:", error);
|
|
return shutdown();
|
|
});
|
|
nitroApp.router.get(
|
|
"/_nitro/tasks",
|
|
defineEventHandler(async (event) => {
|
|
const _tasks = await Promise.all(
|
|
Object.entries(tasks).map(async ([name, task]) => {
|
|
const _task = await task.resolve?.();
|
|
return [name, { description: _task?.meta?.description }];
|
|
})
|
|
);
|
|
return {
|
|
tasks: Object.fromEntries(_tasks),
|
|
scheduledTasks
|
|
};
|
|
})
|
|
);
|
|
nitroApp.router.use(
|
|
"/_nitro/tasks/:name",
|
|
defineEventHandler(async (event) => {
|
|
const name = getRouterParam(event, "name");
|
|
const payload = {
|
|
...getQuery$1(event),
|
|
...await readBody(event).then((r) => r?.payload).catch(() => ({}))
|
|
};
|
|
return await runTask(name, { payload });
|
|
})
|
|
);
|
|
function listen(useRandomPort = Boolean(
|
|
NITRO_NO_UNIX_SOCKET || process.versions.webcontainer || "Bun" in globalThis && process.platform === "win32"
|
|
)) {
|
|
return new Promise((resolve, reject) => {
|
|
try {
|
|
listener = server.listen(useRandomPort ? 0 : getSocketAddress(), () => {
|
|
const address = server.address();
|
|
parentPort?.postMessage({
|
|
event: "listen",
|
|
address: typeof address === "string" ? { socketPath: address } : { host: "localhost", port: address?.port }
|
|
});
|
|
resolve();
|
|
});
|
|
} catch (error) {
|
|
reject(error);
|
|
}
|
|
});
|
|
}
|
|
function getSocketAddress() {
|
|
const socketName = `nitro-worker-${process.pid}-${threadId}-${NITRO_DEV_WORKER_ID}-${Math.round(Math.random() * 1e4)}.sock`;
|
|
if (process.platform === "win32") {
|
|
return join(String.raw`\\.\pipe`, socketName);
|
|
}
|
|
if (process.platform === "linux") {
|
|
const nodeMajor = Number.parseInt(process.versions.node.split(".")[0], 10);
|
|
if (nodeMajor >= 20) {
|
|
return `\0${socketName}`;
|
|
}
|
|
}
|
|
return join(tmpdir(), socketName);
|
|
}
|
|
async function shutdown() {
|
|
server.closeAllConnections?.();
|
|
await Promise.all([
|
|
new Promise((resolve) => listener?.close(resolve)),
|
|
nitroApp.hooks.callHook("close").catch(console.error)
|
|
]);
|
|
parentPort?.postMessage({ event: "exit" });
|
|
}
|
|
|
|
const _messages = { "appName": "Nuxt", "statusCode": 500, "statusMessage": "Internal server error", "description": "This page is temporarily unavailable.", "refresh": "Refresh this page" };
|
|
const template$1 = (messages) => {
|
|
messages = { ..._messages, ...messages };
|
|
return '<!DOCTYPE html><html lang="en"><head><title>' + escapeHtml(messages.statusCode) + " - " + escapeHtml(messages.statusMessage) + " | " + escapeHtml(messages.appName) + `</title><meta charset="utf-8"><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0" name="viewport"><script>!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();<\/script><style>*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.grid{display:grid}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.place-content-center{place-content:center}.overflow-hidden{overflow:hidden}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-\\[80px\\]{font-size:80px}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\\[\\#020420\\]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\\[\\#64748B\\]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-wide{letter-spacing:.025em}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\\:bg-\\[\\#020420\\]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\\:text-\\[110px\\]{font-size:110px}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}}</style></head><body class="antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"><div class="max-w-520px text-center"><h1 class="font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]">` + escapeHtml(messages.statusCode) + '</h1><h2 class="font-semibold mb-2 sm:text-3xl text-2xl">' + escapeHtml(messages.statusMessage) + '</h2><p class="mb-4 px-2 text-[#64748B] text-md">' + escapeHtml(messages.description) + "</p></div></body></html>";
|
|
};
|
|
|
|
const error500 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
template: template$1
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
const template = "";
|
|
|
|
const _virtual__spaTemplate = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
template: template
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
const styles = {};
|
|
|
|
const styles$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: styles
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
function joinURL$4(base, path) {
|
|
if (!path) return base;
|
|
return base.replace(/\/+$/, "") + "/" + path.replace(/^\/+/, "");
|
|
}
|
|
const ____path_$8 = defineEventHandler((event) => {
|
|
const config = useRuntimeConfig();
|
|
const envCookie = getCookie(event, "websopy_api_env");
|
|
const isDevEnv = envCookie === "dev";
|
|
const appApiBase = isDevEnv ? "http://127.0.0.1:9500" : config.public.appApiBase || "https://websopy-api.websoft.top";
|
|
const path = getRouterParam(event, "path") || "";
|
|
const search = getRequestURL(event).search;
|
|
const target = joinURL$4(appApiBase + "/api/app", path) + search;
|
|
const tenantId = getHeader(event, "tenantid") || config.public.tenantId;
|
|
const authorization = getHeader(event, "authorization");
|
|
return proxyRequest(event, target, {
|
|
headers: {
|
|
TenantId: String(tenantId),
|
|
...authorization ? { Authorization: String(authorization) } : {}
|
|
}
|
|
});
|
|
});
|
|
|
|
const ____path_$9 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: ____path_$8
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
function joinURL$3(base, path) {
|
|
if (!path) return base;
|
|
return base.replace(/\/+$/, "") + "/" + path.replace(/^\/+/, "");
|
|
}
|
|
const ____path_$6 = defineEventHandler((event) => {
|
|
const config = useRuntimeConfig();
|
|
const fileServerBase = config.public.fileServerBase || "https://server.websoft.top";
|
|
const path = getRouterParam(event, "path") || "";
|
|
const search = getRequestURL(event).search;
|
|
const target = joinURL$3(fileServerBase, path) + search;
|
|
const tenantId = getHeader(event, "tenantid") || config.public.tenantId;
|
|
const authorization = getHeader(event, "authorization");
|
|
return proxyRequest(event, target, {
|
|
headers: {
|
|
TenantId: String(tenantId),
|
|
...authorization ? { Authorization: String(authorization) } : {}
|
|
}
|
|
});
|
|
});
|
|
|
|
const ____path_$7 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: ____path_$6
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
function joinURL$2(base, path) {
|
|
if (!path) return base;
|
|
return base.replace(/\/+$/, "") + "/" + path.replace(/^\/+/, "");
|
|
}
|
|
const ____path_$4 = defineEventHandler((event) => {
|
|
const config = useRuntimeConfig();
|
|
const envCookie = getCookie(event, "websopy_api_env");
|
|
const isDevEnv = envCookie === "dev";
|
|
const mpApiBase = isDevEnv ? "http://127.0.0.1:9500" : config.public.mpApiBase || "https://mp-api.websoft.top";
|
|
const path = getRouterParam(event, "path") || "";
|
|
const search = getRequestURL(event).search;
|
|
const target = joinURL$2(mpApiBase, path) + search;
|
|
const tenantId = getHeader(event, "tenantid") || config.public.tenantId;
|
|
const authorization = getHeader(event, "authorization");
|
|
return proxyRequest(event, target, {
|
|
headers: {
|
|
TenantId: String(tenantId),
|
|
...authorization ? { Authorization: String(authorization) } : {}
|
|
}
|
|
});
|
|
});
|
|
|
|
const ____path_$5 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: ____path_$4
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
function joinURL$1(base, path) {
|
|
if (!path) return base;
|
|
return base.replace(/\/+$/, "") + "/" + path.replace(/^\/+/, "");
|
|
}
|
|
const ____path_$2 = defineEventHandler((event) => {
|
|
const config = useRuntimeConfig();
|
|
const envCookie = getCookie(event, "websopy_api_env");
|
|
const isDevEnv = envCookie === "dev";
|
|
const serverApiBase = isDevEnv ? "https://server.websoft.top/api" : config.public.serverApiBase || config.public.ServerApi || "https://server.websoft.top/api";
|
|
const path = getRouterParam(event, "path") || "";
|
|
const search = getRequestURL(event).search;
|
|
const target = joinURL$1(serverApiBase, path) + search;
|
|
const tenantId = getHeader(event, "tenantid") || config.public.tenantId;
|
|
const authorization = getHeader(event, "authorization");
|
|
return proxyRequest(event, target, {
|
|
headers: {
|
|
TenantId: String(tenantId),
|
|
...authorization ? { Authorization: String(authorization) } : {}
|
|
}
|
|
});
|
|
});
|
|
|
|
const ____path_$3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: ____path_$2
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
function joinURL(base, path) {
|
|
if (!path) return base;
|
|
return base.replace(/\/+$/, "") + "/" + path.replace(/^\/+/, "");
|
|
}
|
|
const ____path_ = defineEventHandler((event) => {
|
|
const config = useRuntimeConfig();
|
|
const mpApiBase = config.public.mpApiBase || "https://mp-api.websoft.top";
|
|
const path = getRouterParam(event, "path") || "";
|
|
const search = getRequestURL(event).search;
|
|
const target = joinURL(mpApiBase + "/api/cms", path) + search;
|
|
const tenantId = getHeader(event, "tenantid") || config.public.tenantId;
|
|
return proxyRequest(event, target, {
|
|
headers: {
|
|
TenantId: String(tenantId)
|
|
}
|
|
});
|
|
});
|
|
|
|
const ____path_$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: ____path_
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
const getSiteInfo_get = defineEventHandler(async (event) => {
|
|
var _a;
|
|
const config = useRuntimeConfig();
|
|
const query = getQuery$1(event);
|
|
const modulesApiBase = config.public.modulesApiBase || config.public.ApiBase || "https://websopy-api.websoft.top/api";
|
|
const tenantId = getHeader(event, "tenantid") || config.public.tenantId || config.public.TenantId || "5";
|
|
const authorization = getHeader(event, "authorization");
|
|
try {
|
|
return await $fetch$1("/cms/cms-website/getSiteInfo", {
|
|
baseURL: modulesApiBase,
|
|
headers: {
|
|
TenantId: String(tenantId),
|
|
...authorization ? { Authorization: String(authorization) } : {}
|
|
},
|
|
query
|
|
});
|
|
} catch (error) {
|
|
throw createError({
|
|
statusCode: (error == null ? void 0 : error.statusCode) || ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) || 502,
|
|
statusMessage: (error == null ? void 0 : error.statusMessage) || "Failed to fetch site info"
|
|
});
|
|
}
|
|
});
|
|
|
|
const getSiteInfo_get$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: getSiteInfo_get
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
const pageAll_get = defineEventHandler(async (event) => {
|
|
var _a;
|
|
const config = useRuntimeConfig();
|
|
const query = getQuery$1(event);
|
|
const modulesApiBase = config.public.modulesApiBase || config.public.ApiBase || "https://websopy-api.websoft.top/api";
|
|
const tenantId = getHeader(event, "tenantid") || config.public.tenantId || config.public.TenantId || "5";
|
|
const authorization = getHeader(event, "authorization");
|
|
try {
|
|
return await $fetch$1("/cms/cms-website/pageAll", {
|
|
baseURL: modulesApiBase,
|
|
headers: {
|
|
TenantId: String(tenantId),
|
|
...authorization ? { Authorization: String(authorization) } : {}
|
|
},
|
|
query
|
|
});
|
|
} catch (error) {
|
|
throw createError({
|
|
statusCode: (error == null ? void 0 : error.statusCode) || ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) || 502,
|
|
statusMessage: (error == null ? void 0 : error.statusMessage) || "Failed to fetch pageAll"
|
|
});
|
|
}
|
|
});
|
|
|
|
const pageAll_get$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: pageAll_get
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
|
|
function renderPayloadResponse(ssrContext) {
|
|
return {
|
|
body: stringify(splitPayload(ssrContext).payload, ssrContext._payloadReducers) ,
|
|
statusCode: getResponseStatus(ssrContext.event),
|
|
statusMessage: getResponseStatusText(ssrContext.event),
|
|
headers: {
|
|
"content-type": "application/json;charset=utf-8" ,
|
|
"x-powered-by": "Nuxt"
|
|
}
|
|
};
|
|
}
|
|
function renderPayloadJsonScript(opts) {
|
|
const contents = opts.data ? stringify(opts.data, opts.ssrContext._payloadReducers) : "";
|
|
const payload = {
|
|
"type": "application/json",
|
|
"innerHTML": contents,
|
|
"data-nuxt-data": appId,
|
|
"data-ssr": !(opts.ssrContext.noSSR)
|
|
};
|
|
{
|
|
payload.id = "__NUXT_DATA__";
|
|
}
|
|
if (opts.src) {
|
|
payload["data-src"] = opts.src;
|
|
}
|
|
const config = uneval(opts.ssrContext.config);
|
|
return [
|
|
payload,
|
|
{
|
|
innerHTML: `window.__NUXT__={};window.__NUXT__.config=${config}`
|
|
}
|
|
];
|
|
}
|
|
function splitPayload(ssrContext) {
|
|
const { data, prerenderedAt, ...initial } = ssrContext.payload;
|
|
return {
|
|
initial: { ...initial, prerenderedAt },
|
|
payload: { data, prerenderedAt }
|
|
};
|
|
}
|
|
|
|
const renderSSRHeadOptions = {"omitLineBreaks":true};
|
|
|
|
globalThis.__buildAssetsURL = buildAssetsURL;
|
|
globalThis.__publicAssetsURL = publicAssetsURL;
|
|
const HAS_APP_TELEPORTS = !!(appTeleportAttrs.id);
|
|
const APP_TELEPORT_OPEN_TAG = HAS_APP_TELEPORTS ? `<${appTeleportTag}${propsToString(appTeleportAttrs)}>` : "";
|
|
const APP_TELEPORT_CLOSE_TAG = HAS_APP_TELEPORTS ? `</${appTeleportTag}>` : "";
|
|
const PAYLOAD_URL_RE = /^[^?]*\/_payload.json(?:\?.*)?$/ ;
|
|
const renderer = defineRenderHandler(async (event) => {
|
|
const nitroApp = useNitroApp();
|
|
const ssrError = event.path.startsWith("/__nuxt_error") ? getQuery$1(event) : null;
|
|
if (ssrError && !("__unenv__" in event.node.req)) {
|
|
throw createError({
|
|
statusCode: 404,
|
|
statusMessage: "Page Not Found: /__nuxt_error"
|
|
});
|
|
}
|
|
const ssrContext = createSSRContext(event);
|
|
const headEntryOptions = { mode: "server" };
|
|
ssrContext.head.push(appHead, headEntryOptions);
|
|
if (ssrError) {
|
|
ssrError.statusCode &&= Number.parseInt(ssrError.statusCode);
|
|
if (typeof ssrError.data === "string") {
|
|
try {
|
|
ssrError.data = destr(ssrError.data);
|
|
} catch {
|
|
}
|
|
}
|
|
setSSRError(ssrContext, ssrError);
|
|
}
|
|
const isRenderingPayload = PAYLOAD_URL_RE.test(ssrContext.url);
|
|
if (isRenderingPayload) {
|
|
const url = ssrContext.url.substring(0, ssrContext.url.lastIndexOf("/")) || "/";
|
|
ssrContext.url = url;
|
|
event._path = event.node.req.url = url;
|
|
}
|
|
const routeOptions = getRouteRules(event);
|
|
if (routeOptions.ssr === false) {
|
|
ssrContext.noSSR = true;
|
|
}
|
|
const renderer = await getRenderer(ssrContext);
|
|
const _rendered = await renderer.renderToString(ssrContext).catch(async (error) => {
|
|
if (ssrContext._renderResponse && error.message === "skipping render") {
|
|
return {};
|
|
}
|
|
const _err = !ssrError && ssrContext.payload?.error || error;
|
|
await ssrContext.nuxt?.hooks.callHook("app:error", _err);
|
|
throw _err;
|
|
});
|
|
const inlinedStyles = [];
|
|
await ssrContext.nuxt?.hooks.callHook("app:rendered", { ssrContext, renderResult: _rendered });
|
|
if (ssrContext._renderResponse) {
|
|
return ssrContext._renderResponse;
|
|
}
|
|
if (ssrContext.payload?.error && !ssrError) {
|
|
throw ssrContext.payload.error;
|
|
}
|
|
if (isRenderingPayload) {
|
|
const response = renderPayloadResponse(ssrContext);
|
|
return response;
|
|
}
|
|
const NO_SCRIPTS = routeOptions.noScripts;
|
|
const { styles, scripts } = getRequestDependencies(ssrContext, renderer.rendererContext);
|
|
if (inlinedStyles.length) {
|
|
ssrContext.head.push({ style: inlinedStyles });
|
|
}
|
|
const link = [];
|
|
for (const resource of Object.values(styles)) {
|
|
if ("inline" in getQuery(resource.file)) {
|
|
continue;
|
|
}
|
|
link.push({ rel: "stylesheet", href: renderer.rendererContext.buildAssetsURL(resource.file), crossorigin: "" });
|
|
}
|
|
if (link.length) {
|
|
ssrContext.head.push({ link }, headEntryOptions);
|
|
}
|
|
if (!NO_SCRIPTS) {
|
|
ssrContext.head.push({
|
|
link: getPreloadLinks(ssrContext, renderer.rendererContext)
|
|
}, headEntryOptions);
|
|
ssrContext.head.push({
|
|
link: getPrefetchLinks(ssrContext, renderer.rendererContext)
|
|
}, headEntryOptions);
|
|
ssrContext.head.push({
|
|
script: renderPayloadJsonScript({ ssrContext, data: ssrContext.payload })
|
|
}, {
|
|
...headEntryOptions,
|
|
// this should come before another end of body scripts
|
|
tagPosition: "bodyClose",
|
|
tagPriority: "high"
|
|
});
|
|
}
|
|
if (!routeOptions.noScripts) {
|
|
const tagPosition = "head";
|
|
ssrContext.head.push({
|
|
script: Object.values(scripts).map((resource) => ({
|
|
type: resource.module ? "module" : null,
|
|
src: renderer.rendererContext.buildAssetsURL(resource.file),
|
|
defer: resource.module ? null : true,
|
|
// if we are rendering script tag payloads that import an async payload
|
|
// we need to ensure this resolves before executing the Nuxt entry
|
|
tagPosition,
|
|
crossorigin: ""
|
|
}))
|
|
}, headEntryOptions);
|
|
}
|
|
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(ssrContext.head, renderSSRHeadOptions);
|
|
const htmlContext = {
|
|
htmlAttrs: htmlAttrs ? [htmlAttrs] : [],
|
|
head: normalizeChunks([headTags]),
|
|
bodyAttrs: bodyAttrs ? [bodyAttrs] : [],
|
|
bodyPrepend: normalizeChunks([bodyTagsOpen, ssrContext.teleports?.body]),
|
|
body: [
|
|
replaceIslandTeleports(ssrContext, _rendered.html) ,
|
|
APP_TELEPORT_OPEN_TAG + (HAS_APP_TELEPORTS ? joinTags([ssrContext.teleports?.[`#${appTeleportAttrs.id}`]]) : "") + APP_TELEPORT_CLOSE_TAG
|
|
],
|
|
bodyAppend: [bodyTags]
|
|
};
|
|
await nitroApp.hooks.callHook("render:html", htmlContext, { event });
|
|
return {
|
|
body: renderHTMLDocument(htmlContext),
|
|
statusCode: getResponseStatus(event),
|
|
statusMessage: getResponseStatusText(event),
|
|
headers: {
|
|
"content-type": "text/html;charset=utf-8",
|
|
"x-powered-by": "Nuxt"
|
|
}
|
|
};
|
|
});
|
|
function normalizeChunks(chunks) {
|
|
const result = [];
|
|
for (const _chunk of chunks) {
|
|
const chunk = _chunk?.trim();
|
|
if (chunk) {
|
|
result.push(chunk);
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function joinTags(tags) {
|
|
return tags.join("");
|
|
}
|
|
function joinAttrs(chunks) {
|
|
if (chunks.length === 0) {
|
|
return "";
|
|
}
|
|
return " " + chunks.join(" ");
|
|
}
|
|
function renderHTMLDocument(html) {
|
|
return `<!DOCTYPE html><html${joinAttrs(html.htmlAttrs)}><head>${joinTags(html.head)}</head><body${joinAttrs(html.bodyAttrs)}>${joinTags(html.bodyPrepend)}${joinTags(html.body)}${joinTags(html.bodyAppend)}</body></html>`;
|
|
}
|
|
|
|
const renderer$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
__proto__: null,
|
|
default: renderer
|
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
//# sourceMappingURL=index.mjs.map
|