user.js 4.0 KB
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1 2 3 4
import service from '@/utils/request'

// @Summary 用户登录
// @Produce  application/json
Mr.奇淼('s avatar
Mr.奇淼( 已提交
5
// @Param data body {username:"string",password:"string"}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
6 7
// @Router /base/login [post]
export const login = (data) => {
何秀钢 已提交
8 9 10 11 12
  return service({
    url: '/base/login',
    method: 'post',
    data: data
  })
Mr.奇淼('s avatar
Mr.奇淼( 已提交
13 14
}

Mr.奇淼('s avatar
Mr.奇淼( 已提交
15
// @Summary 获取验证码
Mr.奇淼('s avatar
Mr.奇淼( 已提交
16 17
// @Produce  application/json
// @Param data body {username:"string",password:"string"}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
18 19
// @Router /base/captcha [post]
export const captcha = (data) => {
何秀钢 已提交
20 21 22 23 24
  return service({
    url: '/base/captcha',
    method: 'post',
    data: data
  })
25
}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
26 27

// @Summary 用户注册
L
liuyang 已提交
28
// @Produce  application/json
Mr.奇淼('s avatar
Mr.奇淼( 已提交
29 30
// @Param data body {username:"string",password:"string"}
// @Router /base/resige [post]
31
export const register = (data) => {
何秀钢 已提交
32 33 34 35 36 37 38 39 40 41 42
  return service({
    url: '/user/register',
    method: 'post',
    data: data
  })
}

// @Summary 修改密码
// @Produce  application/json
// @Param data body {username:"string",password:"string",newPassword:"string"}
// @Router /user/changePassword [post]
L
liuyang 已提交
43
export const changePassword = (data) => {
何秀钢 已提交
44 45 46 47 48
  return service({
    url: '/user/changePassword',
    method: 'post',
    data: data
  })
Mr.奇淼('s avatar
Mr.奇淼( 已提交
49 50
}

何秀钢 已提交
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
// @Tags User
// @Summary 分页获取用户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /user/getUserList [post]
export const getUserList = (data) => {
  return service({
    url: '/user/getUserList',
    method: 'post',
    data: data
  })
}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
66 67 68 69 70 71 72 73 74 75

// @Tags User
// @Summary 设置用户权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.SetUserAuth true "设置用户权限"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/setUserAuthority [post]
export const setUserAuthority = (data) => {
何秀钢 已提交
76 77 78 79 80
  return service({
    url: '/user/setUserAuthority',
    method: 'post',
    data: data
  })
81 82 83 84 85 86 87 88 89 90 91
}

// @Tags SysUser
// @Summary 删除用户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SetUserAuth true "删除用户"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/deleteUser [delete]
export const deleteUser = (data) => {
何秀钢 已提交
92 93 94 95 96
  return service({
    url: '/user/deleteUser',
    method: 'delete',
    data: data
  })
97 98 99 100 101 102 103 104 105 106 107
}

// @Tags SysUser
// @Summary 设置用户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysUser true "设置用户信息"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/setUserInfo [put]
export const setUserInfo = (data) => {
何秀钢 已提交
108 109 110 111 112 113
  return service({
    url: '/user/setUserInfo',
    method: 'put',
    data: data
  })
}
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143

// @Tags User
// @Summary 设置用户权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.setUserAuthorities true "设置用户权限"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/setUserAuthorities [post]
export const setUserAuthorities = (data) => {
  return service({
    url: '/user/setUserAuthorities',
    method: 'post',
    data: data
  })
}

// @Tags User
// @Summary 获取用户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /user/getUserInfo [get]
export const getUserInfo = () => {
  return service({
    url: '/user/getUserInfo',
    method: 'get'
  })
}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
144

145 146 147 148 149 150 151 152 153

// @Tags User
// @Summary 重置密码
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /user/resetPassword [put]
export const resetPassword = (data) => {
Mr.奇淼('s avatar
Mr.奇淼( 已提交
154 155
  return service({
    url: '/user/resetPassword',
156 157
    method: 'put',
    data: data
Mr.奇淼('s avatar
Mr.奇淼( 已提交
158 159
  })
}