29 lines
436 B
JavaScript
29 lines
436 B
JavaScript
import fetch from 'utils/fetch'
|
|
|
|
export function loginByUsername (username, password) {
|
|
const data = {
|
|
username,
|
|
password
|
|
}
|
|
return fetch({
|
|
url: '/login/login',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function logout () {
|
|
return fetch({
|
|
url: '/login/logout',
|
|
method: 'post'
|
|
})
|
|
}
|
|
|
|
export function getInfo (token) {
|
|
return fetch({
|
|
url: '/user/info',
|
|
method: 'get',
|
|
params: { token }
|
|
})
|
|
}
|
|
|