mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-23 10:44:59 +01:00
Fixed UX
This commit is contained in:
@@ -3,8 +3,11 @@ import Cookies from 'js-cookie'
|
||||
|
||||
import router from '../router'
|
||||
import store from '../store'
|
||||
import { translate } from 'vue-gettext'
|
||||
import { bus } from '@/main'
|
||||
|
||||
const _axios = axios.create()
|
||||
const { gettext: $gettext } = translate
|
||||
|
||||
_axios.interceptors.request.use(
|
||||
function (config) {
|
||||
@@ -32,7 +35,7 @@ _axios.interceptors.response.use(
|
||||
return Promise.reject(error)
|
||||
}
|
||||
if (error.response.status === 429) {
|
||||
store.showNotification()
|
||||
bus.$emit('notification', { msg: $gettext('You are throttled, please try later.'), type: 'error' })
|
||||
return Promise.reject(error)
|
||||
}
|
||||
if (error.response.status !== 401 || router.currentRoute.path === '/login/') {
|
||||
|
||||
Reference in New Issue
Block a user