mirror of https://github.com/halo-dev/halo-admin
Add authentication api
parent
cca8e17e91
commit
91aa2739e8
|
@ -18,4 +18,29 @@ adminApi.install = data => {
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue