mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-27 14:57:08 +08:00
feat: 新增修改手机号、修改邮箱、修改密码、修改基本信息
This commit is contained in:
@@ -7,6 +7,7 @@ export interface UserInfo {
|
||||
email: string
|
||||
phone: string
|
||||
avatar: string
|
||||
pwdResetTime: string
|
||||
registrationDate: string
|
||||
deptName: string
|
||||
roles: string[]
|
||||
|
@@ -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'
|
||||
|
39
src/apis/system/user-center.ts
Normal file
39
src/apis/system/user-center.ts
Normal 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}`)
|
||||
}
|
@@ -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}`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user