refs 6930 feat: implements logout in front side
This commit is contained in:
parent
f2ad069186
commit
fdc5ea244f
|
@ -98,7 +98,10 @@ export default class Auth {
|
|||
}
|
||||
|
||||
logout() {
|
||||
let promise = this.$http.post('VnUsers/logout', null, {
|
||||
this.$http.post('VnUsers/logoutMultimedia', null, {headers: {'Authorization': this.vnToken.tokenMultimedia},
|
||||
}).then(({data}) => {
|
||||
if (data) {
|
||||
this.$http.post('VnUsers/logout', null, {
|
||||
headers: {Authorization: this.vnToken.token}
|
||||
}).catch(() => {});
|
||||
|
||||
|
@ -107,8 +110,8 @@ export default class Auth {
|
|||
this.vnModules.reset();
|
||||
this.aclService.reset();
|
||||
this.$state.go('login');
|
||||
|
||||
return promise;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadAcls() {
|
||||
|
|
|
@ -19,7 +19,7 @@ function interceptor($q, vnApp, $translate) {
|
|||
|
||||
if (config.url.charAt(0) !== '/' && apiPath)
|
||||
config.url = `${apiPath}${config.url}`;
|
||||
if (token)
|
||||
if (token && !config.headers.Authorization)
|
||||
config.headers.Authorization = token;
|
||||
if ($translate.use())
|
||||
config.headers['Accept-Language'] = $translate.use();
|
||||
|
|
Loading…
Reference in New Issue