update 调整代码格式

This commit is contained in:
疯狂的狮子Li
2023-04-03 00:05:09 +08:00
parent 8b01bfd2a0
commit 1595cb282a
194 changed files with 12184 additions and 12267 deletions

View File

@ -10,11 +10,11 @@ import { parseStrEmpty } from '@/utils/ruoyi';
* @param query
*/
export function listUser(query: UserQuery): AxiosPromise<UserVO[]> {
return request({
url: '/system/user/list',
method: 'get',
params: query
});
return request({
url: '/system/user/list',
method: 'get',
params: query
});
}
/**
@ -22,32 +22,32 @@ export function listUser(query: UserQuery): AxiosPromise<UserVO[]> {
* @param userId
*/
export function getUser(userId?: string | number): AxiosPromise<UserInfoVO> {
return request({
url: '/system/user/' + parseStrEmpty(userId),
method: 'get'
});
return request({
url: '/system/user/' + parseStrEmpty(userId),
method: 'get'
});
}
/**
* 新增用户
*/
export function addUser(data: UserForm) {
return request({
url: '/system/user',
method: 'post',
data: data
});
return request({
url: '/system/user',
method: 'post',
data: data
});
}
/**
* 修改用户
*/
export function updateUser(data: UserForm) {
return request({
url: '/system/user',
method: 'put',
data: data
});
return request({
url: '/system/user',
method: 'put',
data: data
});
}
/**
@ -55,10 +55,10 @@ export function updateUser(data: UserForm) {
* @param userId 用户ID
*/
export function delUser(userId: Array<string | number> | string | number) {
return request({
url: '/system/user/' + userId,
method: 'delete'
});
return request({
url: '/system/user/' + userId,
method: 'delete'
});
}
/**
@ -67,15 +67,15 @@ export function delUser(userId: Array<string | number> | string | number) {
* @param password 密码
*/
export function resetUserPwd(userId: string | number, password: string) {
const data = {
userId,
password
};
return request({
url: '/system/user/resetPwd',
method: 'put',
data: data
});
const data = {
userId,
password
};
return request({
url: '/system/user/resetPwd',
method: 'put',
data: data
});
}
/**
@ -84,25 +84,25 @@ export function resetUserPwd(userId: string | number, password: string) {
* @param status 用户状态
*/
export function changeUserStatus(userId: number | string, status: string) {
const data = {
userId,
status
};
return request({
url: '/system/user/changeStatus',
method: 'put',
data: data
});
const data = {
userId,
status
};
return request({
url: '/system/user/changeStatus',
method: 'put',
data: data
});
}
/**
* 查询用户个人信息
*/
export function getUserProfile(): AxiosPromise<UserInfoVO> {
return request({
url: '/system/user/profile',
method: 'get'
});
return request({
url: '/system/user/profile',
method: 'get'
});
}
/**
@ -110,11 +110,11 @@ export function getUserProfile(): AxiosPromise<UserInfoVO> {
* @param data 用户信息
*/
export function updateUserProfile(data: UserForm) {
return request({
url: '/system/user/profile',
method: 'put',
data: data
});
return request({
url: '/system/user/profile',
method: 'put',
data: data
});
}
/**
@ -123,15 +123,15 @@ export function updateUserProfile(data: UserForm) {
* @param newPassword 新密码
*/
export function updateUserPwd(oldPassword: string, newPassword: string) {
const data = {
oldPassword,
newPassword
};
return request({
url: '/system/user/profile/updatePwd',
method: 'put',
params: data
});
const data = {
oldPassword,
newPassword
};
return request({
url: '/system/user/profile/updatePwd',
method: 'put',
params: data
});
}
/**
@ -139,11 +139,11 @@ export function updateUserPwd(oldPassword: string, newPassword: string) {
* @param data 头像文件
*/
export function uploadAvatar(data: FormData) {
return request({
url: '/system/user/profile/avatar',
method: 'post',
data: data
});
return request({
url: '/system/user/profile/avatar',
method: 'post',
data: data
});
}
/**
@ -151,10 +151,10 @@ export function uploadAvatar(data: FormData) {
* @param userId 用户ID
*/
export function getAuthRole(userId: string | number): AxiosPromise<{ user: UserVO; roles: RoleVO[] }> {
return request({
url: '/system/user/authRole/' + userId,
method: 'get'
});
return request({
url: '/system/user/authRole/' + userId,
method: 'get'
});
}
/**
@ -162,19 +162,19 @@ export function getAuthRole(userId: string | number): AxiosPromise<{ user: UserV
* @param data 用户ID
*/
export function updateAuthRole(data: { userId: string; roleIds: string }) {
return request({
url: '/system/user/authRole',
method: 'put',
params: data
});
return request({
url: '/system/user/authRole',
method: 'put',
params: data
});
}
/**
* 查询部门下拉树结构
*/
export function deptTreeSelect(): AxiosPromise<DeptVO[]> {
return request({
url: '/system/user/deptTree',
method: 'get'
});
return request({
url: '/system/user/deptTree',
method: 'get'
});
}

View File

@ -6,79 +6,79 @@ import { PostVO } from '@/api/system/post/types';
* 用户信息
*/
export interface UserInfo {
user: UserVO;
roles: string[];
permissions: string[];
user: UserVO;
roles: string[];
permissions: string[];
}
/**
* 用户查询对象类型
*/
export interface UserQuery extends PageQuery {
userName?: string;
phonenumber?: string;
status?: string;
deptId?: string | number;
roleId?: string | number;
userName?: string;
phonenumber?: string;
status?: string;
deptId?: string | number;
roleId?: string | number;
}
/**
* 用户返回对象
*/
export interface UserVO extends BaseEntity {
userId: string | number;
deptId: number;
userName: string;
nickName: string;
userType: string;
email: string;
phonenumber: string;
sex: string;
avatar: string;
status: string;
delFlag: string;
loginIp: string;
loginDate: string;
remark: string;
dept: DeptVO;
roles: RoleVO[];
roleIds: any;
postIds: any;
roleId: any;
admin: boolean;
userId: string | number;
deptId: number;
userName: string;
nickName: string;
userType: string;
email: string;
phonenumber: string;
sex: string;
avatar: string;
status: string;
delFlag: string;
loginIp: string;
loginDate: string;
remark: string;
dept: DeptVO;
roles: RoleVO[];
roleIds: any;
postIds: any;
roleId: any;
admin: boolean;
}
/**
* 用户表单类型
*/
export interface UserForm {
id?: string;
userId?: string;
deptId?: number;
userName: string;
nickName?: string;
password: string;
phonenumber?: string;
email?: string;
sex?: string;
status: string;
remark?: string;
postIds: string[];
roleIds: string[];
id?: string;
userId?: string;
deptId?: number;
userName: string;
nickName?: string;
password: string;
phonenumber?: string;
email?: string;
sex?: string;
status: string;
remark?: string;
postIds: string[];
roleIds: string[];
}
export interface UserInfoVO {
user: UserVO;
roles: RoleVO[];
roleIds: string[];
posts: PostVO[];
postIds: string[];
roleGroup: string;
postGroup: string;
user: UserVO;
roles: RoleVO[];
roleIds: string[];
posts: PostVO[];
postIds: string[];
roleGroup: string;
postGroup: string;
}
export interface ResetPwdForm {
oldPassword: string;
newPassword: string;
confirmPassword: string;
oldPassword: string;
newPassword: string;
confirmPassword: string;
}