feat: 新增修改手机号、修改邮箱、修改密码、修改基本信息

This commit is contained in:
2024-04-27 15:05:00 +08:00
parent 136f07c8e4
commit 99498a3e54
14 changed files with 394 additions and 188 deletions

View File

@@ -7,6 +7,7 @@ export interface UserInfo {
email: string
phone: string
avatar: string
pwdResetTime: string
registrationDate: string
deptName: string
roles: string[]

View File

@@ -2,9 +2,9 @@ export * from './user'
export * from './role'
export * from './menu'
export * from './dept'
export * from '../monitor/log'
export * from './announcement'
export * from './dict'
export * from './file'
export * from './storage'
export * from './option'
export * from './announcement'
export * from './user-center'

View File

@@ -0,0 +1,39 @@
import http from '@/utils/http'
import type * as System from '@/apis/system/type'
const BASE_URL = '/system/user'
/** @desc 修改用户基本信息 */
export function updateUserBaseInfo(data: { nickname: string; gender: number }) {
return http.patch(`${BASE_URL}/basic/info`, data)
}
/** @desc 修改密码 */
export function updateUserPassword(data: { oldPassword: string; newPassword: string }) {
return http.patch(`${BASE_URL}/password`, data)
}
/** @desc 修改手机号 */
export function updateUserPhone(data: { newPhone: string; captcha: string; currentPassword: string }) {
return http.patch(`${BASE_URL}/phone`, data)
}
/** @desc 修改邮箱 */
export function updateUserEmail(data: { newEmail: string; captcha: string; currentPassword: string }) {
return http.patch(`${BASE_URL}/email`, data)
}
/** @desc 获取绑定的三方账号 */
export function listUserSocial() {
return http.get<System.BindSocialAccountRes[]>(`${BASE_URL}/social`)
}
/** @desc 绑定三方账号 */
export function bindSocialAccount(source: string, data: any) {
return http.post(`${BASE_URL}/social/${source}`, data)
}
/** @desc 解绑三方账号 */
export function unbindSocialAccount(source: string) {
return http.del(`${BASE_URL}/social/${source}`)
}

View File

@@ -37,25 +37,3 @@ export function exportUser(query: System.UserQuery) {
export function resetUserPwd(data: any, id: string) {
return http.patch(`${BASE_URL}/${id}/password`, data)
}
/** @desc 修改用户基础信息 */
export function updateUserBaseInfo(data: { nickname?: string; gender?: number }) {
return http.patch(`${BASE_URL}/basic/info`, data)
}
/** @desc 修改邮箱 */
export function updateUserEmail(data: { newEmail: string; captcha: string; currentPassword: string }) {
return http.patch(`${BASE_URL}/email`, data)
}
/**@desc 绑定三方账号 */
export function bindSocialAccount(source: string, data: any) {
return http.post(`${BASE_URL}/social/${source}`, data)
}
/**@desc 获取绑定的三方账号 */
export function getSocialAccount() {
return http.get<System.BindSocialAccountRes[]>(`${BASE_URL}/social`)
}
/**@desc 解绑三方账号 */
export function unbindSocialAccount(source: string) {
return http.del(`${BASE_URL}/social/${source}`)
}