mt-ck-wms-ui/src/api/user.js
2021-12-22 10:05:35 +08:00

119 lines
2.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Date: 2020-12-14 09:07:03
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-12-06 15:14:46
* @FilePath: \basic-admin\src\api\user.js
* @Description: 用户管理 & 登录用户的相关api接口定义
*/
import request from '@/utils/request'
export function login(data) {
const dto = Object.assign(data, {
appType: 1,
userType: 1
})
return request({
url: '/api/passport/login',
// url: '/passport/login',
method: 'post',
data: dto
})
}
export function logout() {
return request({
url: '/api/session/invalidateSessionByMobile',
method: 'post'
})
}
// 获取当前登录的用户信息
// export function getUserInfo(data) {
// return request({
// url: '/passport/getLoginUser',
// method: 'post',
// data
// })
// }
// 修改当前用户密码
export function editUserPW(data) {
return request({
url: '/upms/user/modifyPassword',
method: 'post',
data
})
}
// 当前用户 找回密码
export function findUserPW(data) {
return request({
url: '/upms/user/findPassword',
method: 'post',
data
})
}
// 下面为:用户管理列表
// 获取用户列表 (根据需求可以考虑换成带分页的 /upms/user/page
export function getUserList(data) {
return request({
url: '/upms/user/page',
method: 'post',
data
})
}
// 新增用户
export function addUser(data) {
return request({
url: '/upms/user/add',
method: 'post',
data
})
}
// 删除用户
export function delUser(data) {
return request({
url: '/upms/user/delete',
method: 'post',
data
})
}
// 修改用户信息
export function editUser(data) {
return request({
url: '/upms/user/update',
method: 'post',
data
})
}
// 获取用户详细信息
export function getUserDetail(data) {
return request({
url: '/upms/user/get',
method: 'post',
data
})
}
// 管理员重置用户的密码
export function resetUserPW(data) {
return request({
url: '/upms/user/resetPassword',
method: 'post',
data
})
}
// 启停用户信息
export function enableUser(data) {
return request({
url: '/upms/user/enabled',
method: 'post',
data
})
}