From a42a307a81e299e0207ae59d5a69df9a9283f03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E4=B8=83=E5=B9=B4=E5=A4=8F?= <2098833867@qq.com> Date: Sun, 25 Jun 2023 14:02:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslintrc/.eslintrc-auto-import.json | 5 +- src/api/user.ts | 6 +- src/store/basic.ts | 21 ++ .../user/profile/components/UserDetail.vue | 180 ++++++++++++++++++ .../components/UserDetailAvatarItem.vue | 80 ++++++++ .../profile/components/UserDetailItem.vue | 36 ++++ .../components/UserDetailPasswordItem.vue | 66 +++++++ src/views/user/profile/index.vue | 40 +--- typings/auto-imports.d.ts | 5 +- 9 files changed, 392 insertions(+), 47 deletions(-) create mode 100644 src/views/user/profile/components/UserDetail.vue create mode 100644 src/views/user/profile/components/UserDetailAvatarItem.vue create mode 100644 src/views/user/profile/components/UserDetailItem.vue create mode 100644 src/views/user/profile/components/UserDetailPasswordItem.vue diff --git a/eslintrc/.eslintrc-auto-import.json b/eslintrc/.eslintrc-auto-import.json index c2ef2ee..9c538cd 100644 --- a/eslintrc/.eslintrc-auto-import.json +++ b/eslintrc/.eslintrc-auto-import.json @@ -22,10 +22,6 @@ "elLoading": true, "elMessage": true, "elNotify": true, - "filterAsyncRouter": true, - "filterAsyncRouterByCodes": true, - "filterAsyncRoutesByMenuList": true, - "filterAsyncRoutesByRoles": true, "freshRouter": true, "getCurrentInstance": true, "getCurrentScope": true, @@ -74,6 +70,7 @@ "routerBack": true, "routerPush": true, "routerReplace": true, + "setRouterFromDatabase": true, "shallowReactive": true, "shallowReadonly": true, "shallowRef": true, diff --git a/src/api/user.ts b/src/api/user.ts index f0a4044..9ae67b9 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -47,13 +47,17 @@ export async function getUser(idList): Promise { return post('/user/get', { idList }) } +export async function editUser(data: IUser) { + return post('/user/edit', data) +} + /** * 按照文本搜索前十条用户 * @param keys * @return {Promise} */ export function userSearching(keys) { - return post('user/searching', { keys }) + return post('/user/searching', { keys }) } //修改密码 diff --git a/src/store/basic.ts b/src/store/basic.ts index 4b17e19..3eeb236 100644 --- a/src/store/basic.ts +++ b/src/store/basic.ts @@ -4,6 +4,7 @@ import { defineStore } from 'pinia' import type { RouterTypes } from '~/basic' import defaultSettings from '@/settings' import router, { constantRoutes } from '@/router' +import type { IUser } from '@/api/user' export const useBasicStore = defineStore('basic', { state: () => { @@ -129,3 +130,23 @@ export const useBasicStore = defineStore('basic', { } } }) + +export interface IUserInfo { + userName: string + realName: string + avatar: string + phone: string + id: string + isUse: boolean + team: string + iGameKey: string +} + +export interface IDatabaseType { + createdAt: string + updatedAt: string + createdBy?: string + updatedBy?: string +} + +export interface IUnionUserInfo extends IUserInfo, IUser, IDatabaseType {} diff --git a/src/views/user/profile/components/UserDetail.vue b/src/views/user/profile/components/UserDetail.vue new file mode 100644 index 0000000..78f9a8c --- /dev/null +++ b/src/views/user/profile/components/UserDetail.vue @@ -0,0 +1,180 @@ + + + + + + diff --git a/src/views/user/profile/components/UserDetailAvatarItem.vue b/src/views/user/profile/components/UserDetailAvatarItem.vue new file mode 100644 index 0000000..3824ebe --- /dev/null +++ b/src/views/user/profile/components/UserDetailAvatarItem.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/src/views/user/profile/components/UserDetailItem.vue b/src/views/user/profile/components/UserDetailItem.vue new file mode 100644 index 0000000..cb5f0e4 --- /dev/null +++ b/src/views/user/profile/components/UserDetailItem.vue @@ -0,0 +1,36 @@ + + + + + diff --git a/src/views/user/profile/components/UserDetailPasswordItem.vue b/src/views/user/profile/components/UserDetailPasswordItem.vue new file mode 100644 index 0000000..fc1eb9e --- /dev/null +++ b/src/views/user/profile/components/UserDetailPasswordItem.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/views/user/profile/index.vue b/src/views/user/profile/index.vue index 8b223db..14acaa7 100644 --- a/src/views/user/profile/index.vue +++ b/src/views/user/profile/index.vue @@ -1,47 +1,11 @@