diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2021-11-19 09:57:58 +0100 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2021-11-19 09:57:58 +0100 |
commit | 10abd20260050174dd508038f0b95c5f8f740933 (patch) | |
tree | dfad854c6f510873ae3c12f21457fea1b0c9d72f /src/services/AuthService.js | |
parent | 7f2f1e63826c0acb4514edfb1fbf7a884893f8c4 (diff) | |
download | lom_frontend-10abd20260050174dd508038f0b95c5f8f740933.tar.gz lom_frontend-10abd20260050174dd508038f0b95c5f8f740933.zip |
fix bugs
Diffstat (limited to 'src/services/AuthService.js')
-rw-r--r-- | src/services/AuthService.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/services/AuthService.js b/src/services/AuthService.js index ff1e468..758157c 100644 --- a/src/services/AuthService.js +++ b/src/services/AuthService.js | |||
@@ -5,6 +5,7 @@ const url = 'http://localhost:8000/api/auth/' | |||
5 | 5 | ||
6 | const error_notify = (error) => { | 6 | const error_notify = (error) => { |
7 | for (const [key, values] of Object.entries(error.response.data)) { | 7 | for (const [key, values] of Object.entries(error.response.data)) { |
8 | console.log(values) | ||
8 | values.forEach(value => { | 9 | values.forEach(value => { |
9 | Vue.notify({ | 10 | Vue.notify({ |
10 | type: 'error', | 11 | type: 'error', |
@@ -43,5 +44,16 @@ export default { | |||
43 | }) | 44 | }) |
44 | .catch(error => error_notify(error)) | 45 | .catch(error => error_notify(error)) |
45 | 46 | ||
47 | }, | ||
48 | |||
49 | async logout() { | ||
50 | return await axios | ||
51 | .post(url+'logout/') | ||
52 | .then(res => { | ||
53 | return { | ||
54 | status: res.status | ||
55 | } | ||
56 | }) | ||
57 | .catch(error => error_notify(error)) | ||
46 | } | 58 | } |
47 | } \ No newline at end of file | 59 | } \ No newline at end of file |