diff --git a/components/flow/Index.vue b/components/flow/Index.vue index 41d4d9a..606a14d 100644 --- a/components/flow/Index.vue +++ b/components/flow/Index.vue @@ -21,11 +21,15 @@ provide('flow', props.flow)
-
- +
+ diff --git a/components/module/Image.vue b/components/module/Image.vue index 22255bc..e2fb531 100644 --- a/components/module/Image.vue +++ b/components/module/Image.vue @@ -5,7 +5,7 @@ import type { AppRouter } from '@/server/trpc/routers' type RouterOutput = inferRouterOutputs type ModuleOutput = RouterOutput['module']['get'] type FlowOutput = RouterOutput['flow']['get'] -type Module = Exclude; +type Module = Exclude interface Props { module: Module @@ -28,8 +28,10 @@ const text = computed(() => extractTextFromHTML(props.module.content))
- +
@@ -39,11 +41,15 @@ const text = computed(() => extractTextFromHTML(props.module.content))
-
+
diff --git a/package.json b/package.json index 4dbfe2e..0f9085c 100644 --- a/package.json +++ b/package.json @@ -68,4 +68,4 @@ ] } } -} \ No newline at end of file +} diff --git a/pages/index.vue b/pages/index.vue index 321b65e..cecfc2c 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -28,8 +28,10 @@ defineOgImageComponent('NuxtSeo', {
-
+
{{ item }}
diff --git a/server/flowing.ts b/server/flowing.ts index f6b3c16..b321dc2 100644 --- a/server/flowing.ts +++ b/server/flowing.ts @@ -9,7 +9,7 @@ const prisma = new PrismaClient() /** * 计算两个字符串之间的Levenshtein距离。 * Levenshtein距离是一个字符串相似度的度量,表示从一个字符串转换成另一个字符串所需的最少编辑操作次数(插入、删除或替换字符)。 - * + * * @param a 字符串a,作为比较的基准。 * @param b 字符串b,与字符串a进行比较。 * @returns 两个字符串之间的Levenshtein距离,返回一个数字。 @@ -37,9 +37,9 @@ function levenshteinDistance(a: string, b: string): number { // 计算当前字符替换、插入或删除的代价 const cost = a[i - 1] === b[j - 1] ? 0 : 1 matrix[i][j] = Math.min( - matrix[i - 1][j] + 1, // 插入操作 - matrix[i][j - 1] + 1, // 删除操作 - matrix[i - 1][j - 1] + cost, // 替换操作 + matrix[i - 1][j] + 1, // 插入操作 + matrix[i][j - 1] + 1, // 删除操作 + matrix[i - 1][j - 1] + cost, // 替换操作 ) } } @@ -203,4 +203,4 @@ export async function flowingByFlowId(flowId: string) { }) if (flow) await flowingByFlow(flow) -} \ No newline at end of file +} diff --git a/server/middleware/update-site-config.ts b/server/middleware/update-site-config.ts index 087da5c..6e10d8a 100644 --- a/server/middleware/update-site-config.ts +++ b/server/middleware/update-site-config.ts @@ -2,14 +2,14 @@ import { appRouter } from '@/server/trpc/routers' export default eventHandler(async (e) => { - const caller = appRouter.createCaller({ prisma: e.context.prisma }) + const caller = appRouter.createCaller({ prisma: e.context.prisma }) - const config = await caller.config.get() - // eslint-disable-next-line no-console - console.log(config.siteName) - // updateSiteConfig({ - // name: config.siteName, - // description: config.siteDescription, - // url: config.siteUrl, - // }) + const config = await caller.config.get() + // eslint-disable-next-line no-console + console.log(config.siteName) + // updateSiteConfig({ + // name: config.siteName, + // description: config.siteDescription, + // url: config.siteUrl, + // }) }) diff --git a/stores/useGlobalStore.ts b/stores/useGlobalStore.ts index cf4cfe0..59cf3cf 100644 --- a/stores/useGlobalStore.ts +++ b/stores/useGlobalStore.ts @@ -1,20 +1,20 @@ interface Catalog { - title: string; - anchor: string; - active: boolean; + title: string + anchor: string + active: boolean } interface State { - catalog: Catalog[] + catalog: Catalog[] } -export default defineStore("global", { - state: () => ({ - catalog: [], - }), - actions: { - setCatalog(catalog: Catalog[]) { - this.catalog = catalog - } - }, -}) \ No newline at end of file +export default defineStore('global', { + state: () => ({ + catalog: [], + }), + actions: { + setCatalog(catalog: Catalog[]) { + this.catalog = catalog + }, + }, +}) diff --git a/utils/date.ts b/utils/date.ts index ee54780..9e4cc8c 100644 --- a/utils/date.ts +++ b/utils/date.ts @@ -1,5 +1,5 @@ import dayjs from 'dayjs' export function formatDateTime(source: string | number) { - return dayjs(source).format('MMMM DD, YYYY'); + return dayjs(source).format('MMMM DD, YYYY') }