中国算力平台算力登记系统2.0
yanzhaofeige
5 days ago 37f8463032c06236bfd098133c31cda51217b00f
commit | author | age
43dc29 1 import request from '@/utils/request'
Y 2 import { parseStrEmpty } from "@/utils/ruoyi";
3
4 // 查询用户列表
5 export function listUser(query) {
6   return request({
7     url: '/system/user/list',
8     method: 'get',
9     params: query
10   })
11 }
12
13 // 查询用户详细
14 export function getUser(userId) {
15   return request({
16     url: '/system/user/' + parseStrEmpty(userId),
17     method: 'get'
18   })
19 }
20
21 // 新增用户
22 export function addUser(data) {
23   return request({
24     url: '/system/user',
25     method: 'post',
26     data: data
27   })
28 }
29
30 // 修改用户
31 export function updateUser(data) {
32   return request({
33     url: '/system/user',
34     method: 'put',
35     data: data
36   })
37 }
38
39 // 删除用户
40 export function delUser(userId) {
41   return request({
42     url: '/system/user/' + userId,
43     method: 'delete'
44   })
45 }
46
47 // 用户密码重置
48 export function resetUserPwd(userId, password) {
49   const data = {
50     userId,
51     password
52   }
53   return request({
54     url: '/system/user/resetPwd',
55     method: 'put',
56     data: data
57   })
58 }
59
60 // 用户状态修改
61 export function changeUserStatus(userId, status) {
62   const data = {
63     userId,
64     status
65   }
66   return request({
67     url: '/system/user/changeStatus',
68     method: 'put',
69     data: data
70   })
71 }
72
73 // 查询用户个人信息
74 export function getUserProfile() {
75   return request({
76     url: '/system/user/profile',
77     method: 'get'
78   })
79 }
80
81 // 修改用户个人信息
82 export function updateUserProfile(data) {
83   return request({
84     url: '/system/user/profile',
85     method: 'put',
86     data: data
87   })
88 }
89
90 // 用户密码重置
91 export function updateUserPwd(oldPassword, newPassword) {
92   const data = {
93     oldPassword,
94     newPassword
95   }
96   return request({
97     url: '/system/user/profile/updatePwd',
98     method: 'put',
99     params: data
100   })
101 }
102
103 // 用户头像上传
104 export function uploadAvatar(data) {
105   return request({
106     url: '/system/user/profile/avatar',
107     method: 'post',
108     headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
109     data: data
110   })
111 }
112
113 // 查询授权角色
114 export function getAuthRole(userId) {
115   return request({
116     url: '/system/user/authRole/' + userId,
117     method: 'get'
118   })
119 }
120
121 // 保存授权角色
122 export function updateAuthRole(data) {
123   return request({
124     url: '/system/user/authRole',
125     method: 'put',
126     params: data
127   })
128 }
129
130 // 查询部门下拉树结构
131 export function deptTreeSelect() {
132   return request({
133     url: '/system/user/deptTree',
134     method: 'get'
135   })
136 }