change publish logic.
This commit is contained in:
1 parent
27623a4e93
commit
ce2fa6eec7
6 files changed
+23
-13
No files matched your search
+1
-4
@@ -1,4 +1 @@
|
||||
interface DetailItem {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/// <reference path="./global.d.ts" />
|
||||
|
||||
export interface ApiSuccess<T> {
|
||||
export interface ApiSuccess<T> {
|
||||
errorCode: 0;
|
||||
result: T;
|
||||
tag?: unknown;
|
||||
|
||||
@@ -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<DetailItem>('api/detail?id=11');
|
||||
|
||||
@@ -12,5 +12,3 @@ if (errorContainer instanceof HTMLElement) {
|
||||
const err = window.__SERVER_DATA__;
|
||||
errorContainer.innerText = `${err.errorCode}: ${err.errorMessage}`;
|
||||
}
|
||||
|
||||
export { }
|
||||
@@ -4,7 +4,9 @@
|
||||
"vite.config.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"lib": ["dom", "ES2015"],
|
||||
"types": [ "node" ],
|
||||
"skipLibCheck": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user