user.js 4.2 KB
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1 2 3
import service from '@/utils/request'
// @Summary 用户登录
// @Produce  application/json
Mr.奇淼('s avatar
Mr.奇淼( 已提交
4
// @Param data body {username:"string",password:"string"}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
5 6
// @Router /base/login [post]
export const login = (data) => {
何秀钢 已提交
7 8 9 10 11
  return service({
    url: '/base/login',
    method: 'post',
    data: data
  })
Mr.奇淼('s avatar
Mr.奇淼( 已提交
12 13
}

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

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

何秀钢 已提交
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
// @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.奇淼( 已提交
65 66 67 68 69 70 71 72 73 74

// @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) => {
何秀钢 已提交
75 76 77 78 79
  return service({
    url: '/user/setUserAuthority',
    method: 'post',
    data: data
  })
80 81 82 83 84 85 86 87 88 89 90
}

// @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) => {
何秀钢 已提交
91 92 93 94 95
  return service({
    url: '/user/deleteUser',
    method: 'delete',
    data: data
  })
96 97 98 99 100 101 102 103 104 105 106
}

// @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) => {
何秀钢 已提交
107 108 109 110 111 112
  return service({
    url: '/user/setUserInfo',
    method: 'put',
    data: data
  })
}
113

114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
// @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/setSelfInfo [put]
export const setSelfInfo = (data) => {
  return service({
    url: '/user/setSelfInfo',
    method: 'put',
    data: data
  })
}

130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
// @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.奇淼( 已提交
159 160 161 162 163 164 165

export const resetPassword = () => {
  return service({
    url: '/user/resetPassword',
    method: 'post'
  })
}