user.js 2.2 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) => {
Mr.奇淼('s avatar
Mr.奇淼( 已提交
8
    return service({
Mr.奇淼('s avatar
Mr.奇淼( 已提交
9 10 11 12
        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) => {
Mr.奇淼('s avatar
Mr.奇淼( 已提交
20
    return service({
Mr.奇淼('s avatar
Mr.奇淼( 已提交
21
        url: "/base/captcha",
Mr.奇淼('s avatar
Mr.奇淼( 已提交
22 23 24
        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) => {
Mr.奇淼('s avatar
Mr.奇淼( 已提交
32
        return service({
33
            url: "/base/register",
Mr.奇淼('s avatar
Mr.奇淼( 已提交
34 35 36 37 38 39 40 41
            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) => {
Mr.奇淼('s avatar
Mr.奇淼( 已提交
43 44 45 46 47 48 49 50 51 52 53 54 55 56
        return service({
            url: "/user/changePassword",
            method: 'post',
            data: data
        })
    }
    // @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]
57 58 59 60 61 62
export const getUserList = (data) => {
    return service({
        url: "/user/getUserList",
        method: 'post',
        data: data
    })
Mr.奇淼('s avatar
Mr.奇淼( 已提交
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
}


// @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) => {
    return service({
        url: "/user/setUserAuthority",
        method: 'post',
        data: data
    })
Mr.奇淼('s avatar
Mr.奇淼( 已提交
80
}