welfare-admin/src/api/login.js

57 lines
1.1 KiB
JavaScript

import request from '@/utils/request'
const userApi = {
login: '/login',
logout: '/logout',
getLoginUser: '/getLoginUser',
getUnitNameByInvitationCode: '/person/register/invitation',
register: '/person/register/add'
}
export function login (parameter) {
return request({
url: userApi.login,
method: 'post',
data: parameter
})
}
export function getUnitNameByInvitationCode (parameter) {
return request({
url: userApi.getUnitNameByInvitationCode,
method: 'post',
params: parameter
})
}
export function reqRegister (parameter) {
return request({
url: userApi.register,
method: 'post',
data: parameter,
params: {type: parameter.type, phone: parameter.phone, verifyCode: parameter.code}
})
}
export function getLoginUser (parameter) {
return request({
url: userApi.getLoginUser,
method: 'post',
data: parameter
})
}
export function logout () {
return request({
url: userApi.logout,
method: 'get'
})
}
export function getSmsCaptcha (parameter) {
return request({
url: '/sys/sms/getCode',
method: 'get',
params: parameter
})
}