42 lines
1.7 KiB
JavaScript
42 lines
1.7 KiB
JavaScript
import request from "./request"
|
||
// 导出一个名为login_api的函数,该函数使用request.post方法发送post请求到/api/auth/login路径
|
||
const login = async (param)=> await request.post('/api/auth/login',param)
|
||
|
||
// 导出一个名为registered_api的函数,该函数接收一个参数param,并使用request.post方法发送一个POST请求到/api/Auth/Register接口,请求体为param
|
||
const register = async (param)=> await request.post('/api/Auth/Register',param)
|
||
|
||
// 导出一个名为SendValidateCode_api的函数,该函数使用request.post方法发送POST请求,请求的URL为'/api/Auth/SendValidateCode'
|
||
const SendValidateCode = async (param)=> await request.post(`/api/Auth/SendValidateCode?email=${param}`)
|
||
|
||
//获取所有系统配置
|
||
const getAllConfig = async ()=> await request.get('/api/systemconfig/getallsystemconfig')
|
||
|
||
//获取用户个人信息
|
||
const getUserInfo = async () => await request.get('/api/User/UserInfo')
|
||
|
||
//获取用户列表(分页)
|
||
const getUserList = async (pageIndex,pageSize,desc) => await request.get(`/api/Admin/UserList?pageIndex=${pageIndex}&pageSize=${pageSize}&desc=${desc}`)
|
||
|
||
//获取用户数量
|
||
const getUserCount = async () => await request.get('/api/Admin/UserCount')
|
||
|
||
//删除用户
|
||
const deleteUser = async (id) => await request.delete(`/api/Admin/DeleteUser?userId=${id}`)
|
||
|
||
//获取指定用户信息
|
||
const getUserInfoById = async (id) => await request.get(`/api/Admin/UserInfo?userId=${id}`)
|
||
|
||
//更新用户信息
|
||
const updateUserInfo = async (id,param) => await request.post(`/api/Admin/UpdateUser?userId=${id}`,param)
|
||
export default {
|
||
login,
|
||
register,
|
||
SendValidateCode,
|
||
getAllConfig,
|
||
getUserInfo,
|
||
getUserList,
|
||
getUserCount,
|
||
deleteUser,
|
||
getUserInfoById,
|
||
updateUserInfo
|
||
} |