diff --git a/frontend/packages/admin/src/components/User/UserList.vue b/frontend/packages/admin/src/components/User/UserList.vue index de005a3..537bed2 100644 --- a/frontend/packages/admin/src/components/User/UserList.vue +++ b/frontend/packages/admin/src/components/User/UserList.vue @@ -107,15 +107,16 @@ function handleClickSetRole(id: number, role: number): void {
Unverified: {{ item.unverified_learnware_count }}
-
- - - +
+ IsAdmin: +
@@ -158,7 +159,7 @@ function handleClickSetRole(id: number, role: number): void { @apply grid sm: "grid-cols-[3fr,3fr,1fr,1fr,1fr]" w-1/1; .title { - @apply xl: text-1rem lg:text-lg text-xs sm: (flex flex-col items-start justify-center); + @apply xl: text-1rem lg:text-lg text-sm sm: (flex flex-col items-start justify-center); .link { @apply underline; } diff --git a/frontend/packages/admin/src/router/index.ts b/frontend/packages/admin/src/router/index.ts index ffff4f9..ae516ac 100644 --- a/frontend/packages/admin/src/router/index.ts +++ b/frontend/packages/admin/src/router/index.ts @@ -8,7 +8,7 @@ const Router = createRouter({ { path: "/", name: "Summary", - component: (): Promise => import("@/views/Summary.vue"), + component: (): Promise => import("@admin/views/Summary.vue"), meta: { showInNavBar: true, icon: "mdi-eye", @@ -17,7 +17,7 @@ const Router = createRouter({ { path: "/alllearnware", name: "Learnwares", - component: (): Promise => import("@/views/Learnwares.vue"), + component: (): Promise => import("@admin/views/Learnwares.vue"), meta: { showInNavBar: true, requiredLogin: true, @@ -39,7 +39,7 @@ const Router = createRouter({ { path: "/alluser", name: "Users", - component: (): Promise => import("@/views/Users.vue"), + component: (): Promise => import("@admin/views/Users.vue"), meta: { showInNavBar: true, requiredLogin: true, @@ -79,7 +79,7 @@ const Router = createRouter({ { path: "/login", name: "Login", - component: (): Promise => import("@/views/Login.vue"), + component: (): Promise => import("@admin/views/Login.vue"), meta: { showInNavBar: true, hideWhenLoggedIn: true, diff --git a/frontend/packages/admin/src/views/Learnwares.vue b/frontend/packages/admin/src/views/Learnwares.vue index 3b519b2..7c67d1e 100644 --- a/frontend/packages/admin/src/views/Learnwares.vue +++ b/frontend/packages/admin/src/views/Learnwares.vue @@ -7,7 +7,7 @@ import { fetchex } from "../utils/fetchex"; import { BACKEND_URL } from "@main/request"; import UserRequirement from "@main/components/Search/UserRequirement.vue"; import PageLearnwareList from "@main/components/Learnware/PageLearnwareList.vue"; -import ConfirmDialog from "@/components/Dialogs/ConfirmDialog.vue"; +import ConfirmDialog from "@admin/components/Dialogs/ConfirmDialog.vue"; import type { Filter, LearnwareCardInfo } from "@beiming-system/types/learnware"; const display = useDisplay(); @@ -227,9 +227,13 @@ function handleClickEdit(id: string): void { } function handleClickDelete(id: string): void { - dialog.value.confirm(); - deleteId.value = id; - deleteName.value = (learnwareItems.value.find((item) => item.id === id) as { name: string }).name; + if (dialog.value) { + dialog.value.confirm(); + deleteId.value = id; + deleteName.value = ( + learnwareItems.value.find((item) => item.id === id) as { name: string } + ).name; + } } watch( diff --git a/frontend/packages/admin/src/views/Login.vue b/frontend/packages/admin/src/views/Login.vue index 005f1c0..73982c9 100644 --- a/frontend/packages/admin/src/views/Login.vue +++ b/frontend/packages/admin/src/views/Login.vue @@ -5,7 +5,7 @@ import { useRouter } from "vue-router"; import { useField } from "@beiming-system/hooks"; import { fetchex, hex_md5 } from "../utils"; import { BACKEND_URL } from "@main/request"; -import collaborationImg from "@/assets/images/collaboration.svg?url"; +import collaborationImg from "@admin/assets/images/collaboration.svg?url"; const store = useStore(); diff --git a/frontend/packages/admin/src/views/Users.vue b/frontend/packages/admin/src/views/Users.vue index 96fbd8d..d14841e 100644 --- a/frontend/packages/admin/src/views/Users.vue +++ b/frontend/packages/admin/src/views/Users.vue @@ -6,9 +6,9 @@ import { useRouter } from "vue-router"; import { useI18n } from "vue-i18n"; import { fetchex, saveContentToFile } from "../utils"; import { BACKEND_URL } from "@main/request"; -import SuccessDialog from "@/components/Dialogs/SuccessDialog.vue"; -import ConfirmDialog from "@/components/Dialogs/ConfirmDialog.vue"; -import PageUserList from "@/components/User/PageUserList.vue"; +import SuccessDialog from "@admin/components/Dialogs/SuccessDialog.vue"; +import ConfirmDialog from "@admin/components/Dialogs/ConfirmDialog.vue"; +import PageUserList from "@admin/components/User/PageUserList.vue"; import type { User, Filter } from "@beiming-system/types/user"; const display = useDisplay(); @@ -18,18 +18,18 @@ const router = useRouter(); const { t } = useI18n(); -const deleteDialog = ref>(null); +const deleteDialog = ref>(); const deleteId = ref(""); const deleteName = ref(""); -const resetDialog = ref>(null); +const resetDialog = ref>(); const resetId = ref(""); const resetName = ref(""); -const newPasswordDialog = ref>(null); +const newPasswordDialog = ref>(); const newPassword = ref(""); -const setRoleDialog = ref>(null); +const setRoleDialog = ref>(); const setRoleId = ref(-1); const setRoleRole = ref(0); const setRoleName = ref(""); @@ -216,19 +216,22 @@ function handleClickReset(id: number): void { } function handleClickDelete(id: number): void { - deleteDialog.value.confirm(); - deleteId.value = String(id); - const userName = userItems.value.find((item) => item.id === id)?.username; - userName && (deleteName.value = userName); + if (deleteDialog.value) { + deleteDialog.value.confirm(); + deleteId.value = String(id); + const userName = userItems.value.find((item) => item.id === id)?.username; + userName && (deleteName.value = userName); + } } function handleClickSetRole(id: number, role: number): void { - setRoleDialog.value.confirm(); - setRoleId.value = Number(id); - setRoleRole.value = Number(role); - const userName = userItems.value.find((item) => item.id === id)?.username; - userName && (setRoleName.value = userName); - fetchByFilterAndPage(filters.value, page.value); + if (setRoleDialog.value) { + setRoleDialog.value.confirm(); + setRoleId.value = Number(id); + setRoleRole.value = Number(role); + const userName = userItems.value.find((item) => item.id === id)?.username; + userName && (setRoleName.value = userName); + } } function setRole(id: number, role: number): Promise { diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index f298697..094a17b 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -137,25 +137,6 @@ importers: packages/main: {} - packages/proxy: - dependencies: - commander: - specifier: ^11.1.0 - version: registry.npmjs.org/commander@11.1.0 - http: - specifier: 0.0.1-security - version: registry.npmjs.org/http@0.0.1-security - http-proxy: - specifier: ^1.18.1 - version: registry.npmjs.org/http-proxy@1.18.1 - devDependencies: - '@types/http-proxy': - specifier: ^1.17.13 - version: registry.npmjs.org/@types/http-proxy@1.17.13 - nodemon: - specifier: ^3.0.1 - version: registry.npmjs.org/nodemon@3.0.1 - packages/types: {} packages: @@ -3602,22 +3583,6 @@ packages: version: 1.4.15 dev: false - registry.npmjs.org/@types/http-proxy@1.17.13: - resolution: {integrity: sha512-GkhdWcMNiR5QSQRYnJ+/oXzu0+7JJEPC8vkWXK351BkhjraZF+1W13CUYARUvX9+NqIU2n6YHA4iwywsc/M6Sw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.13.tgz} - name: '@types/http-proxy' - version: 1.17.13 - dependencies: - '@types/node': registry.npmjs.org/@types/node@20.8.4 - dev: true - - registry.npmjs.org/@types/node@20.8.4: - resolution: {integrity: sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz} - name: '@types/node' - version: 20.8.4 - dependencies: - undici-types: registry.npmjs.org/undici-types@5.25.3 - dev: true - registry.npmjs.org/@vue/compiler-core@3.3.5: resolution: {integrity: sha512-S8Ma+eICI40Y4UotR+iKR729Bma+wERn/xLc+Jz203s5WIW1Sx3qoiONqXGg3Q4vBMa+QHDncULya19ZSJuhog==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.5.tgz} name: '@vue/compiler-core' @@ -3722,35 +3687,12 @@ packages: version: 3.3.5 dev: false - registry.npmjs.org/abbrev@1.1.1: - resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz} - name: abbrev - version: 1.1.1 - dev: true - - registry.npmjs.org/anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz} - name: anymatch - version: 3.1.3 - engines: {node: '>= 8'} - dependencies: - normalize-path: registry.npmjs.org/normalize-path@3.0.0 - picomatch: registry.npmjs.org/picomatch@2.3.1 - dev: true - registry.npmjs.org/balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz} name: balanced-match version: 1.0.2 dev: true - registry.npmjs.org/binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz} - name: binary-extensions - version: 2.2.0 - engines: {node: '>=8'} - dev: true - registry.npmjs.org/brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz} name: brace-expansion @@ -3768,39 +3710,6 @@ packages: balanced-match: registry.npmjs.org/balanced-match@1.0.2 dev: true - registry.npmjs.org/braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/braces/-/braces-3.0.2.tgz} - name: braces - version: 3.0.2 - engines: {node: '>=8'} - dependencies: - fill-range: registry.npmjs.org/fill-range@7.0.1 - dev: true - - registry.npmjs.org/chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz} - name: chokidar - version: 3.5.3 - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: registry.npmjs.org/anymatch@3.1.3 - braces: registry.npmjs.org/braces@3.0.2 - glob-parent: registry.npmjs.org/glob-parent@5.1.2 - is-binary-path: registry.npmjs.org/is-binary-path@2.1.0 - is-glob: registry.npmjs.org/is-glob@4.0.3 - normalize-path: registry.npmjs.org/normalize-path@3.0.0 - readdirp: registry.npmjs.org/readdirp@3.6.0 - optionalDependencies: - fsevents: registry.npmjs.org/fsevents@2.3.3 - dev: true - - registry.npmjs.org/commander@11.1.0: - resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/commander/-/commander-11.1.0.tgz} - name: commander - version: 11.1.0 - engines: {node: '>=16'} - dev: false - registry.npmjs.org/commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/commander/-/commander-4.1.1.tgz} name: commander @@ -3834,21 +3743,6 @@ packages: version: 3.1.2 dev: false - registry.npmjs.org/debug@3.2.7(supports-color@5.5.0): - resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/debug/-/debug-3.2.7.tgz} - id: registry.npmjs.org/debug/3.2.7 - name: debug - version: 3.2.7 - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: registry.npmjs.org/ms@2.1.3 - supports-color: registry.npmjs.org/supports-color@5.5.0 - dev: true - registry.npmjs.org/debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/debug/-/debug-4.3.4.tgz} name: debug @@ -3869,33 +3763,6 @@ packages: version: 2.0.2 dev: false - registry.npmjs.org/eventemitter3@4.0.7: - resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz} - name: eventemitter3 - version: 4.0.7 - dev: false - - registry.npmjs.org/fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz} - name: fill-range - version: 7.0.1 - engines: {node: '>=8'} - dependencies: - to-regex-range: registry.npmjs.org/to-regex-range@5.0.1 - dev: true - - registry.npmjs.org/follow-redirects@1.15.3: - resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz} - name: follow-redirects - version: 1.15.3 - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: false - registry.npmjs.org/fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz} name: fsevents @@ -3906,15 +3773,6 @@ packages: dev: true optional: true - registry.npmjs.org/glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz} - name: glob-parent - version: 5.1.2 - engines: {node: '>= 6'} - dependencies: - is-glob: registry.npmjs.org/is-glob@4.0.3 - dev: true - registry.npmjs.org/graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz} name: graceful-fs @@ -3930,72 +3788,6 @@ packages: engines: {node: '>=4'} dev: true - registry.npmjs.org/http-proxy@1.18.1: - resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz} - name: http-proxy - version: 1.18.1 - engines: {node: '>=8.0.0'} - dependencies: - eventemitter3: registry.npmjs.org/eventemitter3@4.0.7 - follow-redirects: registry.npmjs.org/follow-redirects@1.15.3 - requires-port: registry.npmjs.org/requires-port@1.0.0 - transitivePeerDependencies: - - debug - dev: false - - registry.npmjs.org/http@0.0.1-security: - resolution: {integrity: sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/http/-/http-0.0.1-security.tgz} - name: http - version: 0.0.1-security - dev: false - - registry.npmjs.org/ignore-by-default@1.0.1: - resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz} - name: ignore-by-default - version: 1.0.1 - dev: true - - registry.npmjs.org/is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz} - name: is-binary-path - version: 2.1.0 - engines: {node: '>=8'} - dependencies: - binary-extensions: registry.npmjs.org/binary-extensions@2.2.0 - dev: true - - registry.npmjs.org/is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz} - name: is-extglob - version: 2.1.1 - engines: {node: '>=0.10.0'} - dev: true - - registry.npmjs.org/is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz} - name: is-glob - version: 4.0.3 - engines: {node: '>=0.10.0'} - dependencies: - is-extglob: registry.npmjs.org/is-extglob@2.1.1 - dev: true - - registry.npmjs.org/is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz} - name: is-number - version: 7.0.0 - engines: {node: '>=0.12.0'} - dev: true - - registry.npmjs.org/lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz} - name: lru-cache - version: 6.0.0 - engines: {node: '>=10'} - dependencies: - yallist: registry.npmjs.org/yallist@4.0.0 - dev: true - registry.npmjs.org/magic-string@0.30.5: resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz} name: magic-string @@ -4019,12 +3811,6 @@ packages: version: 2.1.2 dev: true - registry.npmjs.org/ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/ms/-/ms-2.1.3.tgz} - name: ms - version: 2.1.3 - dev: true - registry.npmjs.org/nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz} name: nanoid @@ -4033,54 +3819,12 @@ packages: hasBin: true dev: false - registry.npmjs.org/nodemon@3.0.1: - resolution: {integrity: sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz} - name: nodemon - version: 3.0.1 - engines: {node: '>=10'} - hasBin: true - dependencies: - chokidar: registry.npmjs.org/chokidar@3.5.3 - debug: registry.npmjs.org/debug@3.2.7(supports-color@5.5.0) - ignore-by-default: registry.npmjs.org/ignore-by-default@1.0.1 - minimatch: registry.npmjs.org/minimatch@3.1.2 - pstree.remy: registry.npmjs.org/pstree.remy@1.1.8 - semver: registry.npmjs.org/semver@7.5.4 - simple-update-notifier: registry.npmjs.org/simple-update-notifier@2.0.0 - supports-color: registry.npmjs.org/supports-color@5.5.0 - touch: registry.npmjs.org/touch@3.1.0 - undefsafe: registry.npmjs.org/undefsafe@2.0.5 - dev: true - - registry.npmjs.org/nopt@1.0.10: - resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz} - name: nopt - version: 1.0.10 - hasBin: true - dependencies: - abbrev: registry.npmjs.org/abbrev@1.1.1 - dev: true - - registry.npmjs.org/normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz} - name: normalize-path - version: 3.0.0 - engines: {node: '>=0.10.0'} - dev: true - registry.npmjs.org/picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz} name: picocolors version: 1.0.0 dev: false - registry.npmjs.org/picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz} - name: picomatch - version: 2.3.1 - engines: {node: '>=8.6'} - dev: true - registry.npmjs.org/postcss@8.4.31: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz} name: postcss @@ -4092,46 +3836,6 @@ packages: source-map-js: registry.npmjs.org/source-map-js@1.0.2 dev: false - registry.npmjs.org/pstree.remy@1.1.8: - resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz} - name: pstree.remy - version: 1.1.8 - dev: true - - registry.npmjs.org/readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz} - name: readdirp - version: 3.6.0 - engines: {node: '>=8.10.0'} - dependencies: - picomatch: registry.npmjs.org/picomatch@2.3.1 - dev: true - - registry.npmjs.org/requires-port@1.0.0: - resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz} - name: requires-port - version: 1.0.0 - dev: false - - registry.npmjs.org/semver@7.5.4: - resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/semver/-/semver-7.5.4.tgz} - name: semver - version: 7.5.4 - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: registry.npmjs.org/lru-cache@6.0.0 - dev: true - - registry.npmjs.org/simple-update-notifier@2.0.0: - resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz} - name: simple-update-notifier - version: 2.0.0 - engines: {node: '>=10'} - dependencies: - semver: registry.npmjs.org/semver@7.5.4 - dev: true - registry.npmjs.org/source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz} name: source-map-js @@ -4155,36 +3859,6 @@ packages: engines: {node: '>=4'} dev: false - registry.npmjs.org/to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz} - name: to-regex-range - version: 5.0.1 - engines: {node: '>=8.0'} - dependencies: - is-number: registry.npmjs.org/is-number@7.0.0 - dev: true - - registry.npmjs.org/touch@3.1.0: - resolution: {integrity: sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/touch/-/touch-3.1.0.tgz} - name: touch - version: 3.1.0 - hasBin: true - dependencies: - nopt: registry.npmjs.org/nopt@1.0.10 - dev: true - - registry.npmjs.org/undefsafe@2.0.5: - resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz} - name: undefsafe - version: 2.0.5 - dev: true - - registry.npmjs.org/undici-types@5.25.3: - resolution: {integrity: sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz} - name: undici-types - version: 5.25.3 - dev: true - registry.npmjs.org/vue@3.3.5(typescript@5.2.2): resolution: {integrity: sha512-xYpLEGb25yYU1ul9ZhCcavNZ4YW6PS7YTDdDAd0yc/3w69Tra2BwY4EpKguKddfD56QApXQ17XHq+fJJwEP+UQ==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/vue/-/vue-3.3.5.tgz} id: registry.npmjs.org/vue/3.3.5 @@ -4203,9 +3877,3 @@ packages: '@vue/shared': registry.npmjs.org/@vue/shared@3.3.5 typescript: 5.2.2 dev: false - - registry.npmjs.org/yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==, registry: https://registry.npmjs.com/, tarball: https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz} - name: yallist - version: 4.0.0 - dev: true diff --git a/frontend/shim-vue.d.ts b/frontend/shim-vue.d.ts deleted file mode 100644 index 11a8c6e..0000000 --- a/frontend/shim-vue.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module "*.vue"; diff --git a/frontend/shim.d.ts b/frontend/shim.d.ts new file mode 100644 index 0000000..a9f7b9e --- /dev/null +++ b/frontend/shim.d.ts @@ -0,0 +1,5 @@ +declare module "*.vue" { + import { ComponentOptions } from "vue"; + const componentOptions: ComponentOptions; + export default componentOptions; +} diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 6ab1981..6c73016 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -1,14 +1,16 @@ { "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, "module": "ESNext", - "target": "es2020", - "lib": ["DOM", "ESNext"], + "lib": ["ES2020", "DOM", "DOM.Iterable"], "types": ["vite/client", "node"], "strictNullChecks": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": true, + "paths": { "@main": ["./packages/main/src"], "@main/*": ["./packages/main/src/*"], @@ -17,7 +19,7 @@ "@beiming-system/hooks": ["./packages/hooks/src/index.ts"], "@beiming-system/types": ["./packages/types/src/index.ts"], "@beiming-system/types/*": ["./packages/types/src/*"], - "@beiming-system/locale": ["./packages/locale/src/index.ts"], + "@beiming-system/locale": ["./packages/locale/src/index.ts"] }, /* Bundler mode */ @@ -33,6 +35,12 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": ["./*.ts", "./packages/**/*.ts", "./packages/**/*.vue"], + "include": [ + "./*.ts", + "./*.d.ts", + "./packages/**/*.ts", + "./packages/**/*.d.ts", + "./packages/**/*.vue" + ], "exclude": ["**/dist/**", "node_modules", "**/node_modules", "**/encrypt.ts"] } diff --git a/frontend/vite-env.d.ts b/frontend/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/frontend/vite-env.d.ts @@ -0,0 +1 @@ +///