修改登录判断问题
This commit is contained in:
@@ -1,75 +1,77 @@
|
||||
import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import { getRequestDependencies, getPreloadLinks, getPrefetchLinks, createRenderer } from 'vue-bundle-renderer/runtime';
|
||||
import { j as joinRelativeURL, u as useRuntimeConfig, c as defineRenderHandler, g as getQuery, e as createError, f as getRouteRules, b as useNitroApp, h as getResponseStatusText, i as getResponseStatus } from '../_/nitro.mjs';
|
||||
import { stringify, uneval } from 'devalue';
|
||||
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'vue-bundle-renderer/runtime';
|
||||
import { j as joinRelativeURL, u as useRuntimeConfig, g as getResponseStatusText, c as getResponseStatus, e as defineRenderHandler, f as getQuery, h as createError, i as getRouteRules, b as useNitroApp } from '../_/nitro.mjs';
|
||||
import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
|
||||
import { walkResolver } from 'unhead/utils';
|
||||
import { toValue, isRef, hasInjectionContext, inject, ref, watchEffect, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
||||
import { renderToString } from 'vue/server-renderer';
|
||||
import { propsToString, renderSSRHead } from '@unhead/ssr';
|
||||
import { createServerHead as createServerHead$1, CapoPlugin } from 'unhead';
|
||||
import { unref, version } from 'vue';
|
||||
import { defineHeadPlugin } from '@unhead/shared';
|
||||
import { stringify, uneval } from 'devalue';
|
||||
import { DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin } from 'unhead/plugins';
|
||||
|
||||
const Vue3 = version[0] === "3";
|
||||
|
||||
function resolveUnref(r) {
|
||||
return typeof r === "function" ? r() : unref(r);
|
||||
}
|
||||
function resolveUnrefHeadInput(ref) {
|
||||
if (ref instanceof Promise || ref instanceof Date || ref instanceof RegExp)
|
||||
return ref;
|
||||
const root = resolveUnref(ref);
|
||||
if (!ref || !root)
|
||||
return root;
|
||||
if (Array.isArray(root))
|
||||
return root.map((r) => resolveUnrefHeadInput(r));
|
||||
if (typeof root === "object") {
|
||||
const resolved = {};
|
||||
for (const k in root) {
|
||||
if (!Object.prototype.hasOwnProperty.call(root, k)) {
|
||||
continue;
|
||||
}
|
||||
if (k === "titleTemplate" || k[0] === "o" && k[1] === "n") {
|
||||
resolved[k] = unref(root[k]);
|
||||
continue;
|
||||
}
|
||||
resolved[k] = resolveUnrefHeadInput(root[k]);
|
||||
}
|
||||
return resolved;
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
const VueReactivityPlugin = defineHeadPlugin({
|
||||
hooks: {
|
||||
"entries:resolve": (ctx) => {
|
||||
for (const entry of ctx.entries)
|
||||
entry.resolvedInput = resolveUnrefHeadInput(entry.input);
|
||||
}
|
||||
}
|
||||
});
|
||||
const VueResolver = (_, value) => {
|
||||
return isRef(value) ? toValue(value) : value;
|
||||
};
|
||||
|
||||
const headSymbol = "usehead";
|
||||
function vueInstall(head) {
|
||||
const plugin = {
|
||||
install(app) {
|
||||
if (Vue3) {
|
||||
app.config.globalProperties.$unhead = head;
|
||||
app.config.globalProperties.$head = head;
|
||||
app.provide(headSymbol, head);
|
||||
}
|
||||
app.config.globalProperties.$unhead = head;
|
||||
app.config.globalProperties.$head = head;
|
||||
app.provide(headSymbol, head);
|
||||
}
|
||||
};
|
||||
return plugin.install;
|
||||
}
|
||||
function createServerHead(options = {}) {
|
||||
const head = createServerHead$1(options);
|
||||
head.use(VueReactivityPlugin);
|
||||
|
||||
function injectHead() {
|
||||
if (hasInjectionContext()) {
|
||||
const instance = inject(headSymbol);
|
||||
if (!instance) {
|
||||
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
||||
}
|
||||
function useHead(input, options = {}) {
|
||||
const head = options.head || injectHead();
|
||||
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
|
||||
}
|
||||
function clientUseHead(head, input, options = {}) {
|
||||
const deactivated = ref(false);
|
||||
let entry;
|
||||
watchEffect(() => {
|
||||
const i = deactivated.value ? {} : walkResolver(input, VueResolver);
|
||||
if (entry) {
|
||||
entry.patch(i);
|
||||
} else {
|
||||
entry = head.push(i, options);
|
||||
}
|
||||
});
|
||||
const vm = getCurrentInstance();
|
||||
if (vm) {
|
||||
onBeforeUnmount(() => {
|
||||
entry.dispose();
|
||||
});
|
||||
onDeactivated(() => {
|
||||
deactivated.value = true;
|
||||
});
|
||||
onActivated(() => {
|
||||
deactivated.value = false;
|
||||
});
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
function createHead(options = {}) {
|
||||
const head = createHead$1({
|
||||
...options,
|
||||
propResolvers: [VueResolver]
|
||||
});
|
||||
head.install = vueInstall(head);
|
||||
return head;
|
||||
}
|
||||
|
||||
const unheadPlugins = true ? [CapoPlugin({ track: true })] : [];
|
||||
|
||||
const renderSSRHeadOptions = {"omitLineBreaks":false};
|
||||
|
||||
const appHead = {"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1"},{"charset":"utf-8"}],"link":[{"rel":"stylesheet","href":"//bbs.gter.net/data/cache/style_2_common.css?Z62"}],"style":[],"script":[{"src":"//bbs.gter.net/static/js/common.js","body":true,"charset":"gb2312"},{"innerHTML":"\n window.userInfoWin = {}\n STYLEID = \"2\";\n STATICURL = \"static/\";\n IMGDIR = \"https://bbs.gter.net/template/archy_plt8/image\";\n VERHASH = \"Z62\";\n charset = \"gbk\";\n discuz_uid = \"0\";\n cookiepre = \"4B5x_c0ae_\";\n cookiedomain = \"gter.net\";\n cookiepath = \"/\";\n showusercard = \"1\";\n attackevasive = \"0\";\n disallowfloat = \"\";\n creditnotice = \",\";\n defaultstyle = \"\";\n REPORTURL = \"aHR0cDovL2Jicy5ndGVyLm5ldC9mb3J1bS5waHA/dGlkPTI0MDYzNTYmZ290bz1sYXN0cG9zdA==\";\n SITEURL = \"https://ask.gter.net/\";\n JSPATH = \"static/js/\";","type":"text/javascript","charset":"utf-8"}],"noscript":[]};
|
||||
|
||||
const appRootTag = "div";
|
||||
@@ -84,9 +86,6 @@ const componentIslands = false;
|
||||
|
||||
const appId = "nuxt-app";
|
||||
|
||||
function baseURL() {
|
||||
return useRuntimeConfig().app.baseURL;
|
||||
}
|
||||
function buildAssetsDir() {
|
||||
return useRuntimeConfig().app.buildAssetsDir;
|
||||
}
|
||||
@@ -99,8 +98,8 @@ function publicAssetsURL(...path) {
|
||||
return path.length ? joinRelativeURL(publicBase, ...path) : publicBase;
|
||||
}
|
||||
|
||||
globalThis.__buildAssetsURL = buildAssetsURL;
|
||||
globalThis.__publicAssetsURL = publicAssetsURL;
|
||||
const APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
||||
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
||||
const getClientManifest = () => import('../build/client.manifest.mjs').then((r) => r.default || r).then((r) => typeof r === "function" ? r() : r);
|
||||
const getEntryIds = () => getClientManifest().then((r) => Object.values(r).filter(
|
||||
(r2) => (
|
||||
@@ -108,7 +107,7 @@ const getEntryIds = () => getClientManifest().then((r) => Object.values(r).filte
|
||||
r2._globalCSS
|
||||
)
|
||||
).map((r2) => r2.src));
|
||||
const getServerEntry = () => import('../build/server.mjs').then((r) => r.default || r);
|
||||
const getServerEntry = () => import('../build/server.mjs').then(function (n) { return n.K; }).then((r) => r.default || r);
|
||||
const getSSRStyles = lazyCachedFunction(() => import('../build/styles.mjs').then((r) => r.default || r));
|
||||
const getSSRRenderer = lazyCachedFunction(async () => {
|
||||
const manifest = await getClientManifest();
|
||||
@@ -148,7 +147,7 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
||||
const result = await renderer.renderToString({});
|
||||
const renderToString = (ssrContext) => {
|
||||
const config = useRuntimeConfig(ssrContext.event);
|
||||
ssrContext.modules = ssrContext.modules || /* @__PURE__ */ new Set();
|
||||
ssrContext.modules ||= /* @__PURE__ */ new Set();
|
||||
ssrContext.payload.serverRendered = false;
|
||||
ssrContext.config = {
|
||||
public: config.public,
|
||||
@@ -161,12 +160,74 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
||||
renderToString
|
||||
};
|
||||
});
|
||||
function lazyCachedFunction(fn) {
|
||||
let res = null;
|
||||
return () => {
|
||||
if (res === null) {
|
||||
res = fn().catch((err) => {
|
||||
res = null;
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
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 unheadOptions = {
|
||||
disableDefaults: true,
|
||||
disableCapoSorting: false,
|
||||
plugins: [DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin],
|
||||
};
|
||||
|
||||
const renderSSRHeadOptions = {"omitLineBreaks":false};
|
||||
|
||||
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 APP_ROOT_OPEN_TAG = `<${appRootTag}${propsToString(appRootAttrs)}>`;
|
||||
const APP_ROOT_CLOSE_TAG = `</${appRootTag}>`;
|
||||
const PAYLOAD_URL_RE = /\/_payload.json(\?.*)?$/ ;
|
||||
const PAYLOAD_URL_RE = /^[^?]*\/_payload.json(?:\?.*)?$/ ;
|
||||
const renderer = defineRenderHandler(async (event) => {
|
||||
const nitroApp = useNitroApp();
|
||||
const ssrError = event.path.startsWith("/__nuxt_error") ? getQuery(event) : null;
|
||||
@@ -182,16 +243,14 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
const isRenderingIsland = componentIslands;
|
||||
const islandContext = void 0;
|
||||
let url = ssrError?.url || islandContext?.url || event.path;
|
||||
const isRenderingPayload = PAYLOAD_URL_RE.test(url) && true;
|
||||
const isRenderingPayload = PAYLOAD_URL_RE.test(url);
|
||||
if (isRenderingPayload) {
|
||||
url = url.substring(0, url.lastIndexOf("/")) || "/";
|
||||
event._path = url;
|
||||
event.node.req.url = url;
|
||||
}
|
||||
const routeOptions = getRouteRules(event);
|
||||
const head = createServerHead({
|
||||
plugins: unheadPlugins
|
||||
});
|
||||
const head = createHead(unheadOptions);
|
||||
const headEntryOptions = { mode: "server" };
|
||||
{
|
||||
head.push(appHead, headEntryOptions);
|
||||
@@ -236,7 +295,7 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
return response2;
|
||||
}
|
||||
const inlinedStyles = await renderInlineStyles(ssrContext.modules ?? []) ;
|
||||
const NO_SCRIPTS = routeOptions.experimentalNoScripts;
|
||||
const NO_SCRIPTS = routeOptions.noScripts;
|
||||
const { styles, scripts } = getRequestDependencies(ssrContext, renderer.rendererContext);
|
||||
if (ssrContext._preloadManifest) {
|
||||
head.push({
|
||||
@@ -259,7 +318,7 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
head.push({ link }, headEntryOptions);
|
||||
}
|
||||
}
|
||||
if (!NO_SCRIPTS && true) {
|
||||
if (!NO_SCRIPTS) {
|
||||
head.push({
|
||||
link: getPreloadLinks(ssrContext, renderer.rendererContext)
|
||||
}, headEntryOptions);
|
||||
@@ -275,7 +334,7 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
tagPriority: "high"
|
||||
});
|
||||
}
|
||||
if (!routeOptions.experimentalNoScripts && true) {
|
||||
if (!routeOptions.noScripts) {
|
||||
head.push({
|
||||
script: Object.values(scripts).map((resource) => ({
|
||||
type: resource.module ? "module" : null,
|
||||
@@ -313,18 +372,6 @@ const renderer = defineRenderHandler(async (event) => {
|
||||
};
|
||||
return response;
|
||||
});
|
||||
function lazyCachedFunction(fn) {
|
||||
let res = null;
|
||||
return () => {
|
||||
if (res === null) {
|
||||
res = fn().catch((err) => {
|
||||
res = null;
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
function normalizeChunks(chunks) {
|
||||
return chunks.filter(Boolean).map((i) => i.trim());
|
||||
}
|
||||
@@ -352,51 +399,11 @@ async function renderInlineStyles(usedModules) {
|
||||
}
|
||||
return Array.from(inlinedStyles).map((style) => ({ innerHTML: style }));
|
||||
}
|
||||
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 renderer$1 = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
default: renderer
|
||||
});
|
||||
|
||||
export { buildAssetsURL as a, baseURL as b, renderer$1 as r };
|
||||
export { headSymbol as h, renderer$1 as r, useHead as u };
|
||||
//# sourceMappingURL=renderer.mjs.map
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"renderer.mjs","sources":["../../../../node_modules/.store/@unhead+vue@1.11.19/node_modules/@unhead/vue/dist/shared/vue.ziyDaVMR.mjs","../../../../node_modules/.store/nuxt@3.15.4/node_modules/nuxt/dist/core/runtime/nitro/paths.js","../../../../node_modules/.store/nuxt@3.15.4/node_modules/nuxt/dist/core/runtime/nitro/renderer.js"],"sourcesContent":null,"names":["renderToString","_renderToString"],"mappings":"","x_google_ignoreList":[0,1,2]}
|
||||
{"version":3,"file":"renderer.mjs","sources":["../../../../node_modules/.store/@unhead+vue@2.0.0-rc.10/node_modules/@unhead/vue/dist/shared/vue.N9zWjxoK.mjs","../../../../node_modules/.store/@unhead+vue@2.0.0-rc.10/node_modules/@unhead/vue/dist/shared/vue.BYLJNEcq.mjs","../../../../node_modules/.store/@unhead+vue@2.0.0-rc.10/node_modules/@unhead/vue/dist/server.mjs","../../../../node_modules/.store/nuxt@3.16.0/node_modules/nuxt/dist/core/runtime/nitro/utils/paths.js","../../../../node_modules/.store/nuxt@3.16.0/node_modules/nuxt/dist/core/runtime/nitro/utils/build-files.js","../../../../node_modules/.store/nuxt@3.16.0/node_modules/nuxt/dist/core/runtime/nitro/utils/payload.js","../../../../node_modules/.store/nuxt@3.16.0/node_modules/nuxt/dist/core/runtime/nitro/handlers/renderer.js"],"sourcesContent":null,"names":["renderToString","_renderToString"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6]}
|
||||
Reference in New Issue
Block a user