From ce2fa6eec7eab6d13d2c405e811935fac2c9ca5b Mon Sep 17 00:00:00 2001 From: cl Date: Fri, 23 Oct 2026 16:01:31 +0800 Subject: [PATCH] change publish logic. --- WebApplication1/Source/src/global.d.ts | 5 +---- WebApplication1/Source/src/helper.ts | 4 +--- WebApplication1/Source/src/main.ts | 8 +++++++- WebApplication1/Source/src/pages/error.ts | 2 -- WebApplication1/Source/tsconfig.json | 2 ++ WebApplication1/WebApplication1.csproj | 15 ++++++++++++--- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/WebApplication1/Source/src/global.d.ts b/WebApplication1/Source/src/global.d.ts index b912795..5f28270 100644 --- a/WebApplication1/Source/src/global.d.ts +++ b/WebApplication1/Source/src/global.d.ts @@ -1,4 +1 @@ -interface DetailItem { - id: number; - name: string; -} + \ No newline at end of file diff --git a/WebApplication1/Source/src/helper.ts b/WebApplication1/Source/src/helper.ts index 47c01bf..4703e56 100644 --- a/WebApplication1/Source/src/helper.ts +++ b/WebApplication1/Source/src/helper.ts @@ -1,6 +1,4 @@ -/// - -export interface ApiSuccess { +export interface ApiSuccess { errorCode: 0; result: T; tag?: unknown; diff --git a/WebApplication1/Source/src/main.ts b/WebApplication1/Source/src/main.ts index c101a95..6c064ae 100644 --- a/WebApplication1/Source/src/main.ts +++ b/WebApplication1/Source/src/main.ts @@ -1,7 +1,13 @@ import { ApiError, fetchApi } from './helper'; -const container = document.querySelector('#main'); +declare global { + interface DetailItem { + id: number; + name: string; + } +} +const container = document.querySelector('#main'); if (container) { try { const detail = await fetchApi('api/detail?id=11'); diff --git a/WebApplication1/Source/src/pages/error.ts b/WebApplication1/Source/src/pages/error.ts index db419e3..b861a5b 100644 --- a/WebApplication1/Source/src/pages/error.ts +++ b/WebApplication1/Source/src/pages/error.ts @@ -12,5 +12,3 @@ if (errorContainer instanceof HTMLElement) { const err = window.__SERVER_DATA__; errorContainer.innerText = `${err.errorCode}: ${err.errorMessage}`; } - -export { } diff --git a/WebApplication1/Source/tsconfig.json b/WebApplication1/Source/tsconfig.json index 31a14a7..edf51f9 100644 --- a/WebApplication1/Source/tsconfig.json +++ b/WebApplication1/Source/tsconfig.json @@ -4,7 +4,9 @@ "vite.config.ts" ], "compilerOptions": { + "lib": ["dom", "ES2015"], "types": [ "node" ], + "skipLibCheck": true, "module": "esnext", "moduleResolution": "bundler" } diff --git a/WebApplication1/WebApplication1.csproj b/WebApplication1/WebApplication1.csproj index b696a7b..4bd0898 100644 --- a/WebApplication1/WebApplication1.csproj +++ b/WebApplication1/WebApplication1.csproj @@ -5,23 +5,25 @@ disable enable Exe - false + false + true Source\ $(BaseIntermediateOutputPath)$(Configuration)\frontend_build.stamp + - + PreserveNewest + - + + + + + + +