From f372fc0cdcd1af4458443385cff8ece911074ed0 Mon Sep 17 00:00:00 2001 From: shizhong <124974919@qq.com> Date: Thu, 7 Mar 2024 12:51:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20user=20?= =?UTF-8?q?=E5=9C=A8=20IDEA=20=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/user/profile.ts | 44 +++++++------------- src/views/Profile/components/ProfileUser.vue | 4 +- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/src/api/system/user/profile.ts b/src/api/system/user/profile.ts index e78424cc..a1047c94 100644 --- a/src/api/system/user/profile.ts +++ b/src/api/system/user/profile.ts @@ -1,37 +1,25 @@ import request from '@/config/axios' -export interface ProfileDept { - id: number - name: string -} -export interface ProfileRole { - id: number - name: string -} -export interface ProfilePost { - id: number - name: string -} -export interface SocialUser { - id: number - type: number - openid: string - token: string - rawTokenInfo: string - nickname: string - avatar: string - rawUserInfo: string - code: string - state: string -} export interface ProfileVO { id: number username: string nickname: string - dept: ProfileDept - roles: ProfileRole[] - posts: ProfilePost[] - socialUsers: SocialUser[] + dept: { + id: number + name: string + } + roles: { + id: number + name: string + }[] + posts: { + id: number + name: string + }[] + socialUsers: { + type: number + openid: string + }[] email: string mobile: string sex: number diff --git a/src/views/Profile/components/ProfileUser.vue b/src/views/Profile/components/ProfileUser.vue index e1debf6b..61b40320 100644 --- a/src/views/Profile/components/ProfileUser.vue +++ b/src/views/Profile/components/ProfileUser.vue @@ -41,7 +41,7 @@
  • {{ t('profile.user.createTime') }} -
    {{ formatDate(userInfo?.createTime) }}
    +
    {{ formatDate(userInfo.createTime) }}
  • @@ -55,7 +55,7 @@ import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile' defineOptions({ name: 'ProfileUser' }) const { t } = useI18n() -const userInfo = ref() +const userInfo = ref({} as ProfileVO) const getUserInfo = async () => { const users = await getUserProfileApi() userInfo.value = users