From 3d09037217552e5e76cf05d25822809348f628da Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sun, 21 Apr 2024 23:10:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E5=8F=8A=20lock=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 8 ++++---- src/stores/modules/user.ts | 4 +++- src/views/setting/profile/LeftBox.vue | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 0998760a..4469e67d 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "vue": "^3.4.21", "vue-codemirror6": "^1.1.27", "vue-color-kit": "^1.0.5", + "vue-cropper": "^0.6.4", "vue-draggable-plus": "^0.3.5", "vue-echarts": "^6.5.5", "vue-json-pretty": "^2.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 279f48dd..c329b317 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -105,8 +105,8 @@ dependencies: specifier: ^1.0.5 version: 1.0.6(vue@3.4.21) vue-cropper: - specifier: ^1.1.2 - version: 1.1.2 + specifier: ^0.6.4 + version: 0.6.4 vue-draggable-plus: specifier: ^0.3.5 version: 0.3.5(@types/sortablejs@1.15.8) @@ -6295,8 +6295,8 @@ packages: vue: 3.4.21(typescript@5.0.4) dev: false - /vue-cropper@1.1.2: - resolution: {integrity: sha512-S4cmvQzdNiVpNGigFwgULSwxWp55bdD1xf+RIEH+4mLDpD9/MUjNoHf970V3nFX7SerUrPZbOXG/ZBaD6pxfWQ==} + /vue-cropper@0.6.4: + resolution: {integrity: sha512-U3bm17Li/Xwfw2t3pr8/hFE/tYhvwIWqepHK9IFC1TnX1KFd64VyfCD9nMBhPY91RyvMC6jSQgT/DyDNKuTpIQ==} dev: false /vue-demi@0.13.11(vue@3.4.21): diff --git a/src/stores/modules/user.ts b/src/stores/modules/user.ts index 929d335e..acdff911 100644 --- a/src/stores/modules/user.ts +++ b/src/stores/modules/user.ts @@ -8,7 +8,8 @@ import { resetHasRouteFlag } from '@/router/permission' import getAvatar from '@/utils/avatar' const storeSetup = () => { - const userInfo = reactive>({ + const userInfo = reactive>({ + id: '', nickname: '', avatar: '', email: '', @@ -67,6 +68,7 @@ const storeSetup = () => { // 获取用户信息 const getInfo = async () => { const res = await getUserInfoApi() + userInfo.id = res.data.id userInfo.nickname = res.data.nickname userInfo.avatar = getAvatar(res.data.avatar, res.data.gender) userInfo.email = res.data.email diff --git a/src/views/setting/profile/LeftBox.vue b/src/views/setting/profile/LeftBox.vue index a4bd882c..2bf0e3e5 100644 --- a/src/views/setting/profile/LeftBox.vue +++ b/src/views/setting/profile/LeftBox.vue @@ -5,7 +5,7 @@
- + avatar
{{ userInfo.nickname }} @@ -13,7 +13,7 @@
- 88888888 + {{ userInfo.id }}