You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
993 B
62 lines
993 B
2 years ago
|
import request from '@/utils/request'
|
||
|
import { encrypt } from '@/utils/rsaEncrypt'
|
||
|
|
||
|
export function add(data) {
|
||
|
return request({
|
||
|
url: 'api/users',
|
||
|
method: 'post',
|
||
|
data
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function del(ids) {
|
||
|
return request({
|
||
|
url: 'api/users',
|
||
|
method: 'delete',
|
||
|
data: ids
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function edit(data) {
|
||
|
return request({
|
||
|
url: 'api/users',
|
||
|
method: 'put',
|
||
|
data
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function editUser(data) {
|
||
|
return request({
|
||
|
url: 'api/users/center',
|
||
|
method: 'put',
|
||
|
data
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function updatePass(user) {
|
||
|
const data = {
|
||
|
oldPass: encrypt(user.oldPass),
|
||
|
newPass: encrypt(user.newPass)
|
||
|
}
|
||
|
return request({
|
||
|
url: 'api/users/updatePass/',
|
||
|
method: 'post',
|
||
|
data
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function updateEmail(form) {
|
||
|
const data = {
|
||
|
password: encrypt(form.pass),
|
||
|
email: form.email
|
||
|
}
|
||
|
return request({
|
||
|
url: 'api/users/updateEmail/' + form.code,
|
||
|
method: 'post',
|
||
|
data
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export default { add, edit, del }
|
||
|
|