diff --git a/README.md b/README.md index 5afa01e3..ee009f71 100644 --- a/README.md +++ b/README.md @@ -190,27 +190,28 @@ continew-admin # 全局通用项目配置及依赖版本管理 continew-admin └─ continew-admin-ui # 前端项目 ├─ src - │ ├─ api # 请求接口 - │ │ └─ auth # 认证模块 - │ ├─ assets # 静态资源 - │ │ └─ style # 全局样式 - │ ├─ assets # 静态资源 - │ ├─ components # 通用业务组件 - │ ├─ config # 全局配置(包含 echarts 主题) - │ │ └─ settings.json # 配置文件 - │ ├─ directives # 指令集(如需,可自行补充) - │ ├─ hooks # 全局 hooks - │ ├─ layout # 布局 - │ ├─ locale # 国际化语言包 - │ ├─ mock # 模拟数据 - │ ├─ router # 路由配置 - │ ├─ store # 状态管理中心 - │ ├─ types # Typescript 类型 - │ ├─ utils # 工具库 - │ ├─ views # 页面模板 - │ │ └─ login # 登录模块 - │ ├─ App.vue # 视图入口 - │ └─ main.ts # 入口文件 + │ ├─ api # 请求接口 + │ │ └─ auth # 认证模块 + │ ├─ assets # 静态资源 + │ │ └─ style # 全局样式 + │ ├─ assets # 静态资源 + │ ├─ components # 通用业务组件 + │ ├─ config # 全局配置(包含 echarts 主题) + │ │ └─ settings.json # 配置文件 + │ ├─ directives # 指令集(如需,可自行补充) + │ ├─ hooks # 全局 hooks + │ ├─ layout # 布局 + │ ├─ locale # 国际化语言包 + │ ├─ mock # 模拟数据 + │ ├─ router # 路由配置 + │ ├─ store # 状态管理中心 + │ ├─ types # Typescript 类型 + │ ├─ utils # 工具库 + │ ├─ views # 页面模板 + │ │ ├─ login # 登录模块 + │ │ └─ user # 用户模块(用户设置、用户中心) + │ ├─ App.vue # 视图入口 + │ └─ main.ts # 入口文件 ├─ .env.development ├─ .env.production ├─ index.html diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/UserInfoVO.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/UserInfoVO.java new file mode 100644 index 00000000..4322b58b --- /dev/null +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/vo/UserInfoVO.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package top.charles7c.cnadmin.auth.model.vo; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +import lombok.Data; +import lombok.experimental.Accessors; + +import io.swagger.v3.oas.annotations.media.Schema; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import cn.hutool.core.util.DesensitizedUtil; + +import top.charles7c.cnadmin.common.enums.GenderEnum; + +/** + * 用户信息 + * + * @author Charles7c + * @since 2022/12/29 20:15 + */ +@Data +@Accessors(chain = true) +@Schema(description = "用户信息") +public class UserInfoVO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @Schema(description = "用户ID") + private Long userId; + + /** + * 用户名 + */ + @Schema(description = "用户名") + private String username; + + /** + * 昵称 + */ + @Schema(description = "昵称") + private String nickname; + + /** + * 性别(0未知 1男 2女) + */ + @Schema(description = "性别(0未知 1男 2女)") + private GenderEnum gender; + + /** + * 手机号码 + */ + @Schema(description = "手机号码") + private String phone; + + /** + * 邮箱 + */ + @Schema(description = "邮箱") + private String email; + + /** + * 头像地址 + */ + @Schema(description = "头像地址") + private String avatar; + + /** + * 备注 + */ + @Schema(description = "备注") + private String notes; + + /** + * 最后一次修改密码的时间 + */ + @Schema(description = "最后一次修改密码的时间") + private LocalDateTime pwdResetTime; + + /** + * 创建时间 + */ + @JsonIgnore + private LocalDateTime createTime; + + /** + * 注册日期 + */ + @Schema(description = "注册日期") + private LocalDate registrationDate; + + /** + * 用户角色(临时 mock 用,写完角色体系后移除) + */ + private String role = "admin"; + + public String getPhone() { + return DesensitizedUtil.mobilePhone(phone); + } + + public LocalDate getRegistrationDate() { + return createTime.toLocalDate(); + } +} diff --git a/continew-admin-ui/src/api/auth/login.ts b/continew-admin-ui/src/api/auth/login.ts index 04e2181d..86e2cc05 100644 --- a/continew-admin-ui/src/api/auth/login.ts +++ b/continew-admin-ui/src/api/auth/login.ts @@ -28,7 +28,7 @@ export function logout() { } export function getUserInfo() { - return axios.get('/api/user/info'); + return axios.get('/auth/user/info'); } export function getMenuList() { diff --git a/continew-admin-ui/src/api/user-center.ts b/continew-admin-ui/src/api/user-center.ts index 84ec23f1..5816f48e 100644 --- a/continew-admin-ui/src/api/user-center.ts +++ b/continew-admin-ui/src/api/user-center.ts @@ -40,40 +40,9 @@ export function saveUserInfo() { } export interface BasicInfoModel { - email: string; + username: string; nickname: string; - countryRegion: string; - area: string; - address: string; - profile: string; -} - -export interface EnterpriseCertificationModel { - accountType: number; - status: number; - time: string; - legalPerson: string; - certificateType: string; - authenticationNumber: string; - enterpriseName: string; - enterpriseCertificateType: string; - organizationCode: string; -} - -export type CertificationRecord = Array<{ - certificationType: number; - certificationContent: string; - status: number; - time: string; -}>; - -export interface UnitCertification { - enterpriseInfo: EnterpriseCertificationModel; - record: CertificationRecord; -} - -export function queryCertification() { - return axios.get('/api/user/certification'); + gender: number; } export function userUploadApi( diff --git a/continew-admin-ui/src/assets/images/avatar/female.png b/continew-admin-ui/src/assets/images/avatar/female.png new file mode 100644 index 00000000..80a7d56f Binary files /dev/null and b/continew-admin-ui/src/assets/images/avatar/female.png differ diff --git a/continew-admin-ui/src/assets/images/avatar/male.png b/continew-admin-ui/src/assets/images/avatar/male.png new file mode 100644 index 00000000..40839c10 Binary files /dev/null and b/continew-admin-ui/src/assets/images/avatar/male.png differ diff --git a/continew-admin-ui/src/assets/images/avatar/unknown.png b/continew-admin-ui/src/assets/images/avatar/unknown.png new file mode 100644 index 00000000..997732a4 Binary files /dev/null and b/continew-admin-ui/src/assets/images/avatar/unknown.png differ diff --git a/continew-admin-ui/src/components/navbar/index.vue b/continew-admin-ui/src/components/navbar/index.vue index 547ccec9..1cba5c34 100644 --- a/continew-admin-ui/src/components/navbar/index.vue +++ b/continew-admin-ui/src/components/navbar/index.vue @@ -144,7 +144,7 @@ :size="32" :style="{ marginRight: '8px', cursor: 'pointer' }" > - avatar + avatar - - - - - - - +