From f2cfcfeefcdc2875c437339330987d60934b6fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BD=A6=E6=A3=8B?= Date: Wed, 6 Mar 2024 18:20:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20ts=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gpt-vue/packages/package.json | 3 +++ gpt-vue/pnpm-lock.yaml | 9 +++++++++ .../src/components/SearchTable/useAsyncTable.ts | 4 ++-- gpt-vue/projects/vue-admin/src/stores/auth.ts | 6 +++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gpt-vue/packages/package.json b/gpt-vue/packages/package.json index 4c28f6c5..7807fb71 100644 --- a/gpt-vue/packages/package.json +++ b/gpt-vue/packages/package.json @@ -12,5 +12,8 @@ "dependencies": { "axios": "^1.6.7", "uuid": "^9.0.1" + }, + "devDependencies": { + "@types/uuid": "^9.0.8" } } diff --git a/gpt-vue/pnpm-lock.yaml b/gpt-vue/pnpm-lock.yaml index 1973f554..9c4eaf8b 100644 --- a/gpt-vue/pnpm-lock.yaml +++ b/gpt-vue/pnpm-lock.yaml @@ -22,6 +22,11 @@ importers: specifier: ^9.0.1 version: 9.0.1 + devDependencies: + '@types/uuid': + specifier: ^9.0.8 + version: 9.0.8 + projects/vue-admin: dependencies: '@arco-design/web-vue': @@ -975,6 +980,10 @@ packages: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: true + /@types/uuid@9.0.8: + resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==} + dev: true + /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.3.3): resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} engines: {node: ^16.0.0 || >=18.0.0} diff --git a/gpt-vue/projects/vue-admin/src/components/SearchTable/useAsyncTable.ts b/gpt-vue/projects/vue-admin/src/components/SearchTable/useAsyncTable.ts index 444ca1d0..8c13a461 100644 --- a/gpt-vue/projects/vue-admin/src/components/SearchTable/useAsyncTable.ts +++ b/gpt-vue/projects/vue-admin/src/components/SearchTable/useAsyncTable.ts @@ -48,8 +48,8 @@ function useAsyncTable>( page: paginationState.current, pageSize: paginationState.pageSize, }); - tableState.data = data?.items; - paginationState.total = data.total; + tableState.data = (data as any)?.items; + paginationState.total = (data as any)?.total; } finally { tableState.loading = false } diff --git a/gpt-vue/projects/vue-admin/src/stores/auth.ts b/gpt-vue/projects/vue-admin/src/stores/auth.ts index f7a80a82..1e9e90b4 100644 --- a/gpt-vue/projects/vue-admin/src/stores/auth.ts +++ b/gpt-vue/projects/vue-admin/src/stores/auth.ts @@ -5,12 +5,12 @@ import router from '@/router' export const useAuthStore = defineStore({ id: __AUTH_KEY, - state: () => ({ token: null }), + state: () => ({ token: null } as { token: string | null }), actions: { init() { this.$state.token = localStorage.getItem(__AUTH_KEY); }, - async login(params) { + async login(params: any) { try { const { data } = await userLogin(params) if (data) { @@ -29,7 +29,7 @@ export const useAuthStore = defineStore({ await userLogout() if (this.$state.token) { localStorage.removeItem(__AUTH_KEY) - this.$restate.token = null + this.$reset() } Message.success('ι€€ε‡ΊζˆεŠŸ'); router.push({ name: 'Login' })