diff options
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 |
