mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-28 01:04:05 +00:00
Moving change from axios interceptor to specific request.
This commit is contained in:
parent
668e97c5a9
commit
7cc89979f0
2 changed files with 5 additions and 11 deletions
|
@ -7,17 +7,6 @@ if (env === "development" || localStorage.dev === "dev") {
|
||||||
axios.defaults.baseURL = location.protocol + "//" + location.hostname + ":3001";
|
axios.defaults.baseURL = location.protocol + "//" + location.hostname + ":3001";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a response interceptor to catch 404 errors in dymanic routes such as /status/:slug
|
|
||||||
axios.interceptors.response.use(function (response) {
|
|
||||||
return response;
|
|
||||||
}, function (error) {
|
|
||||||
if (error.response.status === 404) {
|
|
||||||
location.href = "/page-not-found";
|
|
||||||
}
|
|
||||||
console.log(error);
|
|
||||||
return Promise.reject(error);
|
|
||||||
});
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -551,6 +551,11 @@ export default {
|
||||||
|
|
||||||
this.incident = res.data.incident;
|
this.incident = res.data.incident;
|
||||||
this.$root.publicGroupList = res.data.publicGroupList;
|
this.$root.publicGroupList = res.data.publicGroupList;
|
||||||
|
}).catch( function (error) {
|
||||||
|
if (error.response.status === 404) {
|
||||||
|
location.href = "/page-not-found";
|
||||||
|
}
|
||||||
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 5mins a loop
|
// 5mins a loop
|
||||||
|
|
Loading…
Reference in a new issue