Add authentication api

pull/9/head
johnniang 2019-04-29 19:32:14 +08:00
parent cca8e17e91
commit 91aa2739e8
1 changed files with 25 additions and 0 deletions

View File

@ -18,4 +18,29 @@ adminApi.install = data => {
method: 'post' method: 'post'
}) })
} }
adminApi.login = (username, password) => {
return service({
url: `${baseUrl}/login`,
data: {
username: username,
password: password
},
method: 'post'
})
}
adminApi.logout = () => {
return service({
url: `${baseUrl}/logout`,
method: 'post'
})
}
adminApi.refreshToken = refreshToken => {
return service({
url: `${baseUrl}/refresh/${refreshToken}`,
method: 'post'
})
}
export default adminApi export default adminApi